Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WCF web service call time out

I am consuming a web service from a url. When I test using SoapUI, I get the response immediately (See image below) and that the request data I sent out made it through to the other end.

So in my C# application I did the same thing, I consumed the web service wsdl and auto generated the proxy class. I create a request based on that proxy class with the exact same request data I used in SoapUI and sent out. I confirmed that at the other end they received my data successfully and no error is shown.

However, I never receive any ID back and after a while I would get this exception:

Error The HTTP request to 'http://someURLWebservice.com/WSoperation' has exceeded the allotted timeout of 00:00:59.9470000. The time allotted to this operation may have been a portion of a longer timeout.

Am I missing something here? I downloaded the WSDL and generated the mock service with SoapUI and if I make a call to that mock web service locally, I would get it right away.the ID back right away.

Here is my code:

 string serverURL = Settings.Default.ExtensionServiceURL;

 //Get Proxy class client
 ext.ExtWSPortTypeClient client = new ext.ExtWSPortTypeClient();
 EndpointAddress addr = new EndpointAddress(serverURL);

 try
   {
      client.Endpoint.Address = addr;
      Uri site = new Uri(serverURL);
      client.Endpoint.ListenUri = site;
      ExtensionData eData = new ExtensionData();
      client.ChannelFactory.CreateChannel();

      Console.WriteLine("Sending Locator Event Request to Web Service");
      ext.locatorEventResponse1 resp = await client.locatorEventAsync(eData.GenerateLocatorEventRequest(ev));
   }
   catch (Exception ex)
   {
       Console.WriteLine("Error " + ex.Message);
   }
   finally
   {
       if (client != null)
       {
          ((ICommunicationObject)client).Close();
       }
   }

enter image description here

like image 233
Fylix Avatar asked Feb 27 '14 17:02

Fylix


People also ask

What is the default timeout for WCF service?

The default is 00:10:00. This setting is only used on the server-side and has no effect on client-side.

What is BasicHttpBinding?

BasicHttpBinding is suitable for communicating with ASP.NET Web Service (ASMX) based services that conform to the WS-Basic Profile that conforms with Web Services. This binding uses HTTP as the transport and text/XML as the default message encoding. Security is disabled by default.

What is a WCF call?

Windows Communication Foundation (WCF) is a framework for building service-oriented applications. Using WCF, you can send data as asynchronous messages from one service endpoint to another. A service endpoint can be part of a continuously available service hosted by IIS, or it can be a service hosted in an application.


1 Answers

In a similar situation, I would start with the following:

Test with the WCF Client and capture the trace file:

  • Configure WCF Tracing for the client
    (http://msdn.microsoft.com/en-us/library/ms733025(v=vs.110).aspx)
  • Send the message via your WCF Client Application
  • Let the call timeout and save the trace log data

Test with the soapUI client and capture the Http Log

  • Clear the soapUI http log (one of the tabs along the bottom)
  • Send the message via the soapUI test request
  • Save the Http Log

Once you have the trace information for both clients, you should be able to compare the transactions and hopefully determine the source of the issue. In particular, I would suggest confirming the service addresses on both sides and then comparing the SOAP envelope to make sure the WCF bindings are set consistently with the soapUI settings.

In addition, you could also use Fiddler to view the web service communications. The following SO post provides good reference links. Fiddler and Monitoring Web Service Traffic

Hope this helps.
Regards,

like image 199
Seymour Avatar answered Oct 20 '22 19:10

Seymour