Search Results

Search found 21130 results on 846 pages for 'nfs client'.

Page 89/846 | < Previous Page | 85 86 87 88 89 90 91 92 93 94 95 96  | Next Page >

  • How do I securely authenticate the calling assembly of a WCF service method?

    - by Tim
    The current situation is as follows: We have an production .net 3.5 WCF service, used by several applications throughout the organization, over wsHttpBinding or netTcpBinding. User authentication is being done on the Transport level, using Windows integrated security. This service has a method Foo(string parameter), which can only be called by members of given AD groups. The string parameter is obligatory. A new client application has come into play (.net 3.5, C# console app), which eliminates the necessity of the string parameter. However, only calls from this particular application should be allowed to omit the string parameter. The identity of the caller of the client application should still be known by the server because the AD group limitation still applies (ruling out impersonation on the client side). I found a way to pass on the "evidence" of the calling (strong-named) assembly in the message headers, but this method is clearly not secure because the "evidence" can easily be spoofed. Also, CAS (code access security) seems like a possible solution, but I can't seem to figure out how to make use of CAS in this particular scenario. Does anyone have a suggestion on how to solve this issue? Edit: I found another thread on this subject; apparently the conclusion there is that it is simply impossible to implement in a secure fashion.

    Read the article

  • Collection is empty when it arrives on the client

    - by digiduck
    One of my entities has an EntitySet< property with [Composition], [Include] and [Association] attributes. I populate this collection in my domain service but when I check its contents when it is received on the client, the collection is empty. I am using Silverlight 4 RTM as well as RIA Services 1.0 RTM. Any ideas what I am doing wrong? Here is the code on my service side: public class RegionDto { public RegionDto() { Cities = new EntitySet<CityDto>(); } [Key] public int Id { get; set; } public string Name { get; set; } [Include] [Composition] [Association("RegionDto_CityDto", "Id", "RegionId")] public EntitySet<CityDto> Cities { get; set; } } public class CityDto { [Key] public int Id { get; set; } public int RegionId { get; set; } public string Name { get; set; } } [EnableClientAccess()] public class RegionDomainService : LinqToEntitiesDomainService<RegionEntities> { public IEnumerable<RegionDto> GetRegions() { var regions = (ObjectContext.Regions .Select(x => new RegionDto { Id = x.ID, Name = x.Name })).ToList(); foreach (var region in regions) { var cities = (ObjectContext.Cities .Where(x => x.RegionID == region.Id) .Select(x => new CityDto { Id = x.ID, Name = x.Name })).ToList(); foreach (var city in cities) { region.Cities.Add(city); } } // each region's Cities collection is populated at this point // however when the client receives it, the Cities collections are all empty return regions; } }

    Read the article

  • Socket errors of 10048 on the client? Possible causes?

    - by Earlz
    Hello, I'm writing a custom TCP server and client and on doing a ton of requests (60,000 to be exact) I begin to get this socket error of 10048, which should mean "the address is already in use." The error keeps happening unless I pause the process for like 2 or 3 minutes and then begin it again, and then it begins to bring up the same error a short while after restarting it. If I pause the client process and restart the server process, I still get the same error on the client. So it is a complete client side problem. This does not make sense though, this error only usually occurs when binding and this error happens on the client and not the server. What could be the possible reasons for it? A small excerpt of my initialization: TcpClient client = new TcpClient(); client.Connect("XXXXX -- some ip", 25000); client.NoDelay = true; NetworkStream clientStream = client.GetStream(); Also, everything else seems to be working fine(including the amount of time it takes to send back and forth) and this works perfectly when using 127.0.0.1 but when putting it on another LAN computer I begin to get the 10048 error. Is there something wrong with how I initialize it? What else could cause this error on the client side?

    Read the article

  • I/O between AIR client using Native process and executable java .jar

    - by aseem behl
    I am using Adobe AIR 2.0 native process API to launch a java executable jar. I/O is handled by writing to the input stream of the java process and reading from the output stream. The application is event based where several events are fired from the server. We catch these events in java code, handle them and write the output to the outputstream using the synchronized static method below. public class ReaderWriter { static Logger logger = Logger.getLogger(ReaderWriter.class); public synchronized static void writeToAir(String output){ try{ byte[] byteArray = output.getBytes(); DataOutputStream dataOutputStream = new DataOutputStream(System.out); dataOutputStream.write(byteArray); dataOutputStream.flush(); } catch (IOException e) { logger.info("Exception while writing the output. " + e); } } } The issue is that some messages are lost between the transfer and not all messages reach the AIR client. If I run the java application from the console I am receiving all the messages. It would be great if somebody could point out what I am missing. Following are some of the listeners used to send the event data to the AIR client. // class used to process Shutdown events from the Session private class SessionShutdownListener implements SessionListener{ public void onEvent(Event e) { Session.Shutdown sd = (Session.Shutdown) e; Session.ShutdownReason sr = sd.getReason(); String eventOutput = "eo;" + "Session Shutdown event ocurred reason=" + sr.strValue() + "\n"; ReaderWriter.writeToAir(eventOutput); } } // class used to process OperationSucceeded events from the Session private class SessionOperationSucceededListener implements SessionListener{ public void onEvent(Event e) { Session.OperationSucceeded os = (Session.OperationSucceeded) e; String eventOutput = "eo;" + "Session OperationSucceeded event ocurred" + "\n"; ReaderWriter.writeToAir(eventOutput); } }

    Read the article

  • Using SoapExtensionAttributes on client side with async web methods

    - by Maxim Polishchuk
    Hey, I have a simple question. I implemented custom soap extension and registered it into client application configuration file. It works fine. (I would like to implement progress bar functionality like http://msdn.microsoft.com/en-us/library/aa480520.aspx) But I don't like some thing - custom soap extension is invoked by every call of my web service. In order to fix this situation (call WS just by required methods) I implemented custom SoapExtensionAttribute like below: [AttributeUsage(AttributeTargets.Method)] public class CustomSoapExtensionAttribute : SoapExtensionAttribute { public override int Priority { get; set; } public CustomSoapExtensionAttribute() : this (1) { } public CustomSoapExtensionAttribute(int priority) { Priority = priority; } public override Type ExtensionType { get { return typeof(CustomSoapExtension); } } } I added this attribute to required methods of web service proxy classes (and removed registration into client configuration file). My soap extension doesn't invoke when required web methods are calling. Can someone help me to solve this problem or select any other solution? Anotherone, I don't know it is important or not - my required methods are async web methods. Best regards, Maxim

    Read the article

  • Help with SOAP request using PHP

    - by mptre
    I'm having a SOAP related problem in PHP. I'm trying to create arbitrary SOAP request using Nusoap_client class. The complete request including headers should look like the example below. Ofcourse the placeholders (string) should be replaced with actual values. POST /services/RecipeCouponAPI11.asmx HTTP/1.1 Host: example.com Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "http://www.example.com/services/GetCouponAll" <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Header> <RCAuthenticator xmlns="http://www.example.com/services/"> <UserName>string</UserName> <Password>string</Password> </RCAuthenticator> </soap:Header> <soap:Body> <GetCouponAll xmlns="http://www.example.com/services/"> <campaignCode>string</campaignCode> </GetCouponAll> </soap:Body> </soap:Envelope> I tried the following code with no luck. Seems like the request isn't formated correctly. Any ideas on how to get his working? <?php $client = new Nusoap_client('http://www.example.com/services/RecipeCouponAPI11.asmx'); $headers = new SoapHeader( 'http://www.example.com/services/', 'RCAuthenticator', (object)array( 'UserName' => 'username', 'Password' => 'password' ), false ); $client->setHeaders(array($headers)); $response = $client->call( 'GetCouponAll', array('campaignCode' => 'campaigncode'), null, 'http://www.example.com/services/GetCouponAll' ); ?> Thanks in advantage!

    Read the article

  • How to send complex types from PHP SoapClient to ASP.NET SOAP server?

    - by xaguilars
    Hello I'm having problems sending arrays, structs and arrays of structs from PHP to an ASP.NET SOAP server... Anyone have a sollution for this? I've googled for days and any sollution worked for me. Perphaps I'm forgetting something... There are examples of my code: $client = new SoapClient($options); $pCriteria = new stdClass(); $pCriteria->type=1; $pCriteria->capacity=4; //Test 1 (fail): $resp = $client->GetRooms(array("pCriteria"=>$pCriteria)); //Test 2 (fail): $resp = $client->GetRooms(array("pCriteria"=>new SoapVar($pCriteria, SOAP_ENC_OBJECT, "TCriteria", "http://www.w3.org/2001/XMLSchema"))); print_r($resp); I don't know how to code functions that require an array of TCriteria (TCriteria[], TCriteria_Array type) either... i've tried sending the raw array, a SoapVar with SOAP_ENC_ARRAY encoding and TCriteria_Array type, ... but it does not work (the SOAP server becomes unavaiable and needs to be restarted). I've tried creating classes for the complex types too, instead of stdClass, but not working. I don't know where's the problem. The server admins cannot help me and I haven't found any sollution over internet. I'm a bit desperate hehe. Can you help me please? Can you provide samples of code with the three cases (array of simple data, array of struct and struct) ? Thanks!

    Read the article

  • Singleton Issues in iOS http client

    - by Andrew Lauer Barinov
    I implemented an HTTP client is iOS that is meant to be a singleton. It is a subclass of AFNetworking's excellent AFHTTPClient My access method is pretty standard: + (LBHTTPClient*) sharedHTTPClient { static dispatch_once_t once = 0; static LBHTTPClient *sharedHTTPClient = nil; dispatch_once(&once, ^{ sharedHTTPClient = [[LBHTTPClient alloc] initHTTPClient]; }); return sharedHTTPClient; } // my init method - (id) initHTTPClient { self = [super initWithBaseURL:[NSURL URLWithString:kBaseURL]]; if (self) { // Sub class specific initializations } return self; } Super's init method is very long, and can be found here However the problem I experience is when the dispatch_once queue is run, the app locks and become unresponsive. When I step through code, I notice that it locks on dispatch_once and then remains frozen. Is this something to do with the main thread locking down? How come it stays locked like that? Also, none of the HTTP client methods fire. Stepping through the code some more, I find this line in dispatch/once.h is where the app locks down: DISPATCH_INLINE DISPATCH_ALWAYS_INLINE DISPATCH_NONNULL_ALL DISPATCH_NOTHROW void _dispatch_once(dispatch_once_t *predicate, dispatch_block_t block) { if (DISPATCH_EXPECT(*predicate, ~0l) != ~0l) { dispatch_once(predicate, block); // App locks here } }

    Read the article

  • Error while uploading file method in Client Object Model Sharepoint 2010

    - by user1481570
    Error while uploading file method in Client Object Model + Sharepoint 2010. Once the file got uploaded. After that though the code compiles with no error I get the error while executing "{"Value does not fall within the expected range."} {System.Collections.Generic.SynchronizedReadOnlyCollection} I have a method which takes care of functionality to upload files /////////////////////////////////////////////////////////////////////////////////////////// public void Upload_Click(string documentPath, byte[] documentStream) { String sharePointSite = "http://cvgwinbasd003:28838/sites/test04"; String documentLibraryUrl = sharePointSite +"/"+ documentPath.Replace('\\','/'); //////////////////////////////////////////////////////////////////// //Get Document List List documentsList = clientContext.Web.Lists.GetByTitle("Doc1"); var fileCreationInformation = new FileCreationInformation(); //Assign to content byte[] i.e. documentStream fileCreationInformation.Content = documentStream; //Allow owerwrite of document fileCreationInformation.Overwrite = true; //Upload URL fileCreationInformation.Url = documentLibraryUrl; Microsoft.SharePoint.Client.File uploadFile = documentsList.RootFolder.Files.Add( fileCreationInformation); //uploadFile.ListItemAllFields.Update(); clientContext.ExecuteQuery(); } ///////////////////////////////////////////////////////////////////////////////////////////////// In the MVC 3.0 application in the controller I have defined the following method to invoke the upload method. ////////////////////////////////////////////////////////////////////////////////////////////////// public ActionResult ProcessSubmit(IEnumerable<HttpPostedFileBase> attachments) { System.IO.Stream uploadFileStream=null; byte[] uploadFileBytes; int fileLength=0; foreach (HttpPostedFileBase fileUpload in attachments) { uploadFileStream = fileUpload.InputStream; fileLength=fileUpload.ContentLength; } uploadFileBytes= new byte[fileLength]; uploadFileStream.Read(uploadFileBytes, 0, fileLength); using (DocManagementService.DocMgmtClient doc = new DocMgmtClient()) { doc.Upload_Click("Doc1/Doc2/Doc2.1/", uploadFileBytes); } return RedirectToAction("SyncUploadResult"); } ////////////////////////////////////////////////////////////////////////////////////////////////// Please help me to locate the error

    Read the article

  • C++ boost.asio server and client connection undersanding

    - by Edgar Buchvalov
    i started learning boost.asio and i have some problems with undersanding tcp connections. There is example from official boost site: #include <ctime> #include <iostream> #include <string> #include <boost/asio.hpp> using boost::asio::ip::tcp; std::string make_daytime_string() { using namespace std; // For time_t, time and ctime; time_t now = time(0); return ctime(&now); } int main() { try { boost::asio::io_service io_service; tcp::acceptor acceptor(io_service, tcp::endpoint(tcp::v4(), 13)); for (;;) { tcp::socket socket(io_service); acceptor.accept(socket); std::string message = make_daytime_string(); boost::system::error_code ignored_error; boost::asio::write(socket, boost::asio::buffer(message), boost::asio::transfer_all(), ignored_error); } } catch (std::exception& e) { std::cerr << e.what() << std::endl; } return 0; } there is question, why if i want to connet to this server via client i have t write: boost::asio::io_service io_service; tcp::resolver resolver(io_service); tcp::resolver::query query(host_ip, "daytime"); //why daytime? tcp::resolver::iterator endpoint_iterator = resolver.resolve(query); tcp::resolver::iterator end; why daytime?, what it meant and where it is inicialized in server, or i just doesn't missed somefing? there is full client code : www.boost.org/doc/libs/1_39_0/doc/html/boost_asio/tutorial/tutdaytime1.html thanks for explanation in advance

    Read the article

  • TimeoutException when WCF Host and Client are in the same process

    - by Pharao2k
    I've ran into a really weird problem. I am building a heavily distributed application where each app instance can either be a Host and/or Client to a WCF-Service (very p2p-like). Everything works fine, as long as the Client and the targeted Host (By which I mean the app, not the Host, since currently everything runs on a single computer (so no Firewall problems etc.)) are NOT the same. IF they are the same, then the app hangs for exactly 1 Minute and then throws a TimeoutException. WCF-Logging did not produce anything helpful. Here is a small app which demonstrates the Problem: public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } private void button1_Click(object sender, RoutedEventArgs e) { var binding = new NetTcpBinding(); var baseAddress = new Uri(@"net.tcp://localhost:4000/Test"); ServiceHost host = new ServiceHost(typeof(TestService), baseAddress); host.AddServiceEndpoint(typeof(ITestService), binding, baseAddress); var debug = host.Description.Behaviors.Find<ServiceDebugBehavior>(); if (debug == null) host.Description.Behaviors.Add(new ServiceDebugBehavior { IncludeExceptionDetailInFaults = true }); else debug.IncludeExceptionDetailInFaults = true; host.Open(); var clientBinding = new NetTcpBinding(); var testProxy = new TestProxy(clientBinding, new EndpointAddress(baseAddress)); testProxy.Test(); } } [ServiceContract] public interface ITestService { [OperationContract] void Test(); } public class TestService : ITestService { public void Test() { MessageBox.Show("foo"); } } public class TestProxy : ClientBase<ITestService>, ITestService { public TestProxy(NetTcpBinding binding, EndpointAddress remoteAddress) : base(binding, remoteAddress) { } public void Test() { Channel.Test(); } } What am I doing wrong? Regards, Pharao2k

    Read the article

  • Web Grid, Client side Binding VS. Server side HTML generation

    - by Ron Harlev
    I'm working on replacing an existing web grid in an ASP.NET web application, with a new implementation. The existing grid is powerful, but not flexible enough. It also brings with it all kind of frameworks we don't like to have on our web pages. While looking into existing options I noticed I can break the available solutions into two main approaches. The older approach is represented best by the ASP.NET GridView. This is a classic ASP.NET control that generates the needed HTML on the server, based on a given set of data. The newer approach is depending on client side rendering, mainly with jQuery. A good example would be jqGrid. Only the data is sent to the client (Usually with JSON or XML) In the GridView case, if I want an AJAX behavior, I would have to implement it with something like an update panel. Is there a definitive choice I should make? Is there a good chance of achieving the same snappy behavior I get with jqGrid (even with many records), with server side rendered controls? Is there some hybrid implementation incorporating both approaches?

    Read the article

  • Long-held TCP sessions in an ASMX client

    - by John
    Hi, I have an ASP.NET application which talks to a third-party SOAP web service. My application uses an ASMX client proxy (i.e. System.Web.Services.Protocols.SoapHttpClientProtocol). The third-party service uses WCF, although I don't expect that makes much difference. I should note that we're using .NET 3.5 SP1. We haven't customised the proxy or done anything unusual - we're just making standard web service requests and getting back the results. We have encapsulated the proxy reference within a using block so it will get disposed after the response is received. We've been told that our application is behaving strangely in its use of TCP sessions. Instead of opening a new TCP session for each request from a new proxy instance (which is what I would have expected it to do), it's apparently keeping several connections alive and re-using them. This is causing some issues at the third party end, as they are expecting us to be using multiple sessions. Is this a known behaviour for the SoapHttpClientProtocol client proxy? If so, is there any way we can override it so that each request results in a new TCP session? Thanks, John

    Read the article

  • IIS not responding to the few requests from the client

    - by Haroon
    I am stuck with an issue with IIS 7.0. I need someone's help to find resolution on this, as this is very urgent requirement for us. Scenario I am trying to host the service in my server (Windows Server 2008 R2 and IIS 7.0) and my client is running in the XP machine with IIS 5.1. Few of my request sent from client get successful response and for few request I am getting the below exception in Visual studio when I try to debug. Exception in Visual studio 2010 An error occurred while receiving the HTTP response to This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to HTTP request context being aborted by the server (possibly due to the service shutting down). See the server logs for more details. When referred to the server event viewer log I got the below events(Application error and System warning) during the above exception. Under System logs - Warning A process serving application pool 'DefaultAppPool' suffered a fatal communication error with the Windows Process Activation Service. The process id was '5372'. The data field contains the error number. Under Application log - Error Faulting application name: w3wp.exe, version: 7.5.7600.16385, time stamp: 0x4a5bd0eb Faulting module name: ntdll.dll, version: 6.1.7600.16559, time stamp: 0x4ba9b802 Exception code: 0xc0000374 Fault offset: 0x00000000000c6df2 Faulting process id: 0x14fc Faulting application start time: 0x01cbd042562e92c3 Faulting application path: c:\windows\system32\inetsrv\w3wp.exe Faulting module path: C:\Windows\SYSTEM32\ntdll.dll Report Id: 95f76467-3c35-11e0-a46e-7071bc5cc1ee From internet I am not able to get the exact solution. Therefore could anyone please help me out from getting resolution for the same that would be really a great help for me. Please let me know if you need more details. Thanks in advance.

    Read the article

  • Adding web reference on client when using Net.TCP

    - by Marko
    Hi everyone... I am trying to using Net.TCP in my WCF Service, which is self hosted, when i try to add this service reference through web reference to my client, i am not able access the classes and methods of that service, can any have any idea to achieve this... How I can add web references in this case. My Service has one method (GetNumber) that returns int. WebService: public class WebService : IWebService { public int GetNumber(int num) { return num + 1; } } Service Contract code: [ServiceContract] public interface IWebService { [OperationContract] int GetNumber(int num); } WCF Service code: ServiceHost host = new ServiceHost(typeof(WebService)); host.AddServiceEndpoint(typeof(IWebService), new NetTcpBinding(), new Uri("net.tcp://" + Dns.GetHostName() + ":1255/WebService")); NetTcpBinding binding = new NetTcpBinding(); binding.TransferMode = TransferMode.Streamed; binding.ReceiveTimeout = TimeSpan.MaxValue; binding.MaxReceivedMessageSize = long.MaxValue; Console.WriteLine("{0}", Dns.GetHostName().ToString()); Console.WriteLine("Opening Web Service..."); host.Open(); Console.WriteLine("Web Service is running on port {0}",1255); Console.WriteLine("Press <ENTER> to EXIT"); Console.ReadLine(); This works fine. Only problem is how to add references of this service in my client application. I just want to send number and to receive an answer. Can anyone help me?

    Read the article

  • Client calls .asmx, Server exposes WCF endpoint

    - by Lucas B
    We have a client that has been configured to connect to an asmx service. We don't want to ask our customers to update their configuration, but we would like to upgrade our service to use WCF. Does anyone know if WCF supports this? If so, what would the configuration file look like? Our asmx service looks like this: <bindings> <binding name="ATransactionSoap" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"> <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /> <security mode="None"> <transport clientCredentialType="None" proxyCredentialType="None" realm="" /> <message clientCredentialType="UserName" algorithmSuite="Default" /> </security> </binding> </basicHttpBinding> </bindings> <client> <endpoint address="http://.../atransaction.asmx" binding="basicHttpBinding" bindingConfiguration="ATransactionSoap" contract="ATransactionSoap" name="ATransactionSoap" />

    Read the article

  • web service client authentication

    - by Jack
    I want to consume Java based web service with c#.net client. The problem is, I couldnt authenticate to the service. it didnt work with this: mywebservice.Credentials = new System.Net.NetworkCredential(userid, userpass); I tried to write base class for my client method. public class ClientProtocols : SoapHttpClientProtocol { protected override WebRequest GetWebRequest(Uri uri) { System.Net.WebRequest request = base.GetWebRequest(uri); if (null != Credentials) request.Headers.Add("Authorization", GetAuthHeader()); return request; } protected override WebResponse GetWebResponse(WebRequest request) { WebResponse response = base.GetWebResponse(request); return response; } private string GetAuthHeader() { StringBuilder sb = new StringBuilder(); sb.Append("Basic "); NetworkCredential cred = Credentials.GetCredential(new Uri(Url), "Basic"); string s = string.Format("{0}:{1}", cred.UserName, cred.Password); sb.Append(Convert.ToBase64String(Encoding.ASCII.GetBytes(s))); return sb.ToString(); } } How can I use this class and authorize to the web service? Thanks.

    Read the article

  • Very strange client/browser issue

    - by Jeriko
    One of our clients has logged a very strange issue with us- We launched a preview for their website, but when it's viewed on their main PC, peculiar things start to happen... At first, the stylesheet wasn't being found, and so accessing any page resulted in one void of all styles. We sent them a direct link to the stylesheet, which was viewable from all our computers in the office - but gave a "File Not Found" error on their side. I then deleted the file, and replaced it with a new blank file, which he could then access. Copy-pasted screen.css contents into this file, and he could then view it fine, and stylesheets magically worked on the site again. Now, he can view styles, but not the referenced header images. The strange thing is that this problem doesn't exist on any other PC we've tested, or on any other site on the problem computer, but obviously we'd like our client's site to work for them. The strange thing is, they can view other sites of ours, hosted on the same server, built on top of the same CMS (and so most of the files are the same) without problem - but are getting 404s for files that most definitely do exist. Stylesheets are not turned off, nor is anything specifically deactivated on their browser (as other sites are fine) Reloading with CTRL+F5 doesn't help The client is using the latest version of firefox Any ideas here on what to try / how to narrow the problem down?

    Read the article

  • How to handle image/gif type response on client side using GWT

    - by user200340
    Hi all, I have a question about how to handle image/gif type response on client side, any suggestion will be great. There is a service which responds for retrieving image (only one each time at the moment) from database. The code is something like, JDBC Connection Construct MYSQL query. Execute query If has ResultSet, retrieve first one { //save image into Blob image, “img” is the only entity in the image table. image = rs.getBlob("img"); } response.setContentType("image/gif"); //set response type InputStream in = image.getBinaryStream(); //output Blob image to InputStream int bufferSize = 1024; //buffer size byte[] buffer = new byte[bufferSize]; //initial buffer int length =0; //read length data from inputstream and store into buffer while ((length = in.read(buffer)) != -1) { out.write(buffer, 0, length); //write into ServletOutputStream } in.close(); out.flush(); //write out The code on client side .... imgform.setAction(GWT.getModuleBaseURL() + "serviceexample/ImgRetrieve"); .... ClickListener { OnClick, then imgform.submit(); } formHandler { onSubmit, form validation onSubmitComplete ??????? //handle response, and display image **Here is my question, i had tried Image img = new Image(GWT.getHostPageBaseURL() +"serviceexample/ImgRetrieve"); mg.setSize("300", "300"); imgpanel.add(img); but i only got a non-displayed image with 300X300 size.** } So, how should i handle the responde in this case? Thanks,

    Read the article

  • rabbitmq-erlang-client, using rebar friendly pkg, works on dev env fails on rebar release

    - by lfurrea
    I am successfully using the rebar-friendly package of rabbitmq-erlang-client for a simple Hello World rebarized and OTP "compliant" app and things work fine on the dev environment. I am able to fire up an erl console and do my application:start(helloworld). and connect to the broker, open up a channel and communicate to queues. However, then I proceed to do rebar generate and it builds up the release just fine, but when I try to fire up from the self contained release package then things suddenly explode. I know rebar releases are known to be an obscure art, but I would like to know what are my options as far as deployment for an app using the rabbitmq-erlang-client. Below you will find the output of the console on the crash: =INFO REPORT==== 18-Dec-2012::16:41:35 === application: session_record exited: {{{badmatch, {error, {'EXIT', {undef, [{amqp_connection_sup,start_link, [{amqp_params_network,<<"guest">>,<<"guest">>,<<"/">>, "127.0.0.1",5672,0,0,0,infinity,none, [#Fun<amqp_auth_mechanisms.plain.3>, #Fun<amqp_auth_mechanisms.amqplain.3>], [],[]}], []}, {supervisor2,do_start_child_i,3, [{file,"src/supervisor2.erl"},{line,391}]}, {supervisor2,handle_call,3, [{file,"src/supervisor2.erl"},{line,413}]}, {gen_server,handle_msg,5, [{file,"gen_server.erl"},{line,588}]}, {proc_lib,init_p_do_apply,3, [{file,"proc_lib.erl"},{line,227}]}]}}}}, [{amqp_connection,start,1, [{file,"src/amqp_connection.erl"},{line,164}]}, {hello_qp,start_link,0,[{file,"src/hello_qp.erl"},{line,10}]}, {session_record_sup,init,1, [{file,"src/session_record_sup.erl"},{line,55}]}, {supervisor_bridge,init,1, [{file,"supervisor_bridge.erl"},{line,79}]}, {gen_server,init_it,6,[{file,"gen_server.erl"},{line,304}]}, {proc_lib,init_p_do_apply,3, [{file,"proc_lib.erl"},{line,227}]}]}, {session_record_app,start,[normal,[]]}} type: permanent

    Read the article

  • Service reference not generating client types

    - by Cranialsurge
    I am trying to consume a WCF service in a class library by adding a service reference to it. In one of the class libraries it gets consumed properly and I can access the client types in order to generate a proxy off of them. However in my second class library (or even in a console test app), when i add the same service reference, it only exposes the types that are involved in the contract operations and not the client type for me to generate a proxy against. e.g. Endpoint has 2 services exposed - ISvc1 and ISvc2. When I add a service reference to this endpoint in the first class library I get ISvc1Client andf ISvc2Client to generate proxies off of in order to use the operations exposed via those 2 contracts. In addition to these clients the service reference also exposes the types involved in the operations like (type 1, type 2 etc.) this is what I need. However when i try to add a service reference to the same endpoing in another console application or class library only Type 1, Type 2 etc. are exposed and not ISvc1Client and ISvc2Client because of which I cannot generate a proxy to access the operations I need. I am unable to determine why the service reference gets properly generated in one class library but not in the other or the test console app.

    Read the article

  • Post complex types to WebApi Client

    - by BumbleBee
    I am new to WebAPI. I have a MVC project and webApi project both reside under the **same solution**. Also, BLL Class library and DAL class library reside under the same solution. Earlier, my MVC project will talk to the BLL now I am trying to create a WebAPi project which stands in between MVC and BLL. Here is what I have come up with so far : I'm using the HTTPClient to post to a WebApi project. My post method on my controller accepts a single parameter (a model). StatsCriteria criteria = new StatsCriteria(); ...... var client = new HttpClient(); var response = client.PostAsJsonAsync("http://localhost:52765/api/reports", criteria).Result; ....... Here's the signature for my controller in Webapi [HttpPost] public CMAReportVM Reports([FromBody] StatsCriteria criteria) { var cmaReport = Service3.GetCMAReport(criteria.Mlsnums); //Create Map to enable mapping business object to View Model Mapper.CreateMap<CMAReport, CMAReportVM>(); // Maps model to VM model class var cmaVM = Mapper.Map<CMAReport, CMAReportVM>(cmaReport); reutn cmaVM; } // and here's my routing: config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } I am getting the following 405 : Method not allowed. As the WebAPI and MVC project both reside under same sloution I am not sure where/how to host my webapi.

    Read the article

  • GUI for server-client program

    - by sksingh73
    I am making a server-client application in c++. In this i am also using shared memory & file read-write operations. my program is completely ready & i now wants to make a gui for it. someone suggested me to go for QT4, but when i tried it, i found i have to re-write 80% of the code because QT has got its own classes & variable. i don't want to do it. i want suggestions from you on this regard. my requirements for gui are very simple i.e there will be a main form, which will have two text boxes in which all messages being sent & received by client & server should be shown. there should be another lineedit box, through which i can send the messages to the other end server. I don't know how to make this gui. someone suggested tcl/tk, other suggested me use php/swig. i am not sure how to go about this. my only requirement is that i want to make this simple gui with minimum of changes in my code. THANX

    Read the article

  • WCF publish/subscribe service, and ASP.NET MVC client

    - by d3j4vu
    I managed to develop a custom WCF service, using the publish / subscribe model, and hosted inside a managed windows service. Everything's working. I developed an interface as the service contract implementing a method definition marked as a non-one way operation contract (OperationContract(IsOneWay = false)]. This, to make possible returns an instance of a custom class derived from System.Web.Mvc.ActionResult. In the MVC app, event fires ok. It wraps inside an action method, (just the one defined in the interface), but, and this is my current problem, i believe that something relative to the execution context of the windows service (and the hosted wcf counterpart) blocks the execution of the action method in the MVC app. This is what i have until now (some pieces ripped off just to be more clear): /// Method definition for the contract's service. Maps to a MVC ActionMethod. [OperationContract(IsOneWay = false)] ActionResult Imagen(string data, CustomActionResult result); The class to hold an ActionResult derived class instance: public class ServiceEventArgsMvc : ServiceEventArgs { /// <summary> /// /// </summary> public CustomActionResult Result { get; set; } } And the code in the MVC client app: /// <summary> /// Just a simple class to hold an abstract ActionResult derived class instance. /// </summary> public ActionResult Image(string data, CustomActionResult result) { ViewData["data"] = data; return View(); } Ok. ActionMethod sucessfully executes...but when it's done (and usually expected obtain a reditection to a View named Image, like the action method), the WCF service throws a Timeout exception, making clear that he's still waiting for a response from the MVC client. The response never arrives, so the MVC app never finish his work (redirect to the "Image" view as expected). Any ideas?. Guess i'm missing something very simple, but i don't know what it could be. This is drivin' me nuts.

    Read the article

  • Best way to keep a .net client app updated with status of another application

    - by rwmnau
    I have a Windows service that's running all the time, and takes some action every 15 minutes. I also have a client WinForms app that displays some information about what the service is doing. I'd like the forms application to keep itself updated with a recent status, but I'm not sure if polling every second is a good move performance-wise. When it starts, my Windows Service opens a WCF named pipe to receive queries (from my client form) Every second, a timer on the winform sends a query to the pipe, and then displays the results. If the pipe isn't there, the form displays that the service isn't running. Is that the best way to do this? If my service opens the pipe when it starts, will it always stay open (until I close it or my service stops)? In addition to polling the service, maybe there's some way for the service to notify any watching applications of certain events, like starting and stopping processing? That way, I could poll less, since I'd presumably know about big events already, and would only be polling for progress. Anything that I'm missing?

    Read the article

< Previous Page | 85 86 87 88 89 90 91 92 93 94 95 96  | Next Page >