0

Major Change

Found:

<binding name="EntityExtractionPortBinding" 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>

in app.config and chaged all timeouts there, even then it is throwing the same exception. CHANGE:

<binding name="EntityExtractionPortBinding" closeTimeout="00:60:00"
      openTimeout="00:60:00" receiveTimeout="00:60:00" sendTimeout="00:60: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>

I am getting an TimeOut exception while calling a webservice. The webservice is deployed in java and my client is a c# winform. The webservice is deployed on TOMCAT server It gives following exception on the client side:

The request channel timed out while waiting for a reply after 00:00:56.9230000. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout.

Exception on client side:

System.TimeoutException was caught Message=The request channel timed out while waiting for a reply after 00:01:00. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout. Source=mscorlib StackTrace: Server stack trace: at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout) at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at abc.ae.SnippetExtraction.DictionaryLookUp.EntityExtraction.extractNERTokensFromFile(extractNERTokensFromFileRequest request) at abc.ae.SnippetExtraction.DictionaryLookUp.EntityExtractionClient.abc.ae.SnippetExtraction.DictionaryLookUp.EntityExtraction.extractNERTokensFromFile(extractNERTokensFromFileRequest request) in C:\Users\htiwari\Documents\ae-establishin\ae\CommonUtilities\abc\ae-Re\SnippetExtraction\Service References\DictionaryLookUp\Reference.cs:line 1069 at abc.ae.SnippetExtraction.DictionaryLookUp.EntityExtractionClient.extractNERTokensFromFile(String fileName) in C:\Users\htiwari\Documents\ae-establishin\ae\CommonUtilities\abc\ae-Re\SnippetExtraction\Service References\DictionaryLookUp\Reference.cs:line 1075 at abc.ae.SnippetExtraction.TokenizeAndMap2.ConfigureSnippetList(Snippet snippet) in C:\Users\htiwari\Documents\ae-establishin\ae\CommonUtilities\abc\ae-Re\SnippetExtraction\TokenizeAndMap2.cs:line 42 InnerException: System.TimeoutException Message=The HTTP request to 'http://172.22.4.224:8084/EntityExtraction/EntityExtraction' has exceeded the allotted timeout of 00:01:00. The time allotted to this operation may have been a portion of a longer timeout. Source=System.ServiceModel StackTrace: at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason) at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout) at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout) InnerException: System.Net.WebException Message=The operation has timed out Source=System StackTrace: at System.Net.HttpWebRequest.GetResponse() at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout) InnerException:

Webservice is accessed through WSDL. I have following code in my app.config

CODE AT app.config AT CLIENT SIDE

<endpoint address="http://localhost:8084/EntityExtraction/EntityExtraction"
    binding="basicHttpBinding" bindingConfiguration="EntityExtractionPortBinding"
    contract="DictionaryLookUp.EntityExtraction" name="EntityExtractionPort" />
harshit
  • 3,788
  • 3
  • 31
  • 54
  • can you explain more in detail? – Ami Sep 28 '12 at 10:52
  • Wow are you trying to win a contest in asking unanswerable questions... more information would really help. Can you reach the WS via soapUI for starters, what is the Stacktrace? – dngfng Sep 28 '12 at 10:52
  • What have you tried to solve this? Your question lacks some important details. – ilvez Sep 28 '12 at 10:54
  • This exception is thrown sometimes only. Like when I give a large input, this exception is thrown. Can you please tell what other details I should mention in the question? – harshit Sep 28 '12 at 10:59
  • You should test identical queries with soapui and look how much time it takes to response. You may need to better webservice or increase timeout. – ilvez Sep 28 '12 at 11:02
  • Can you please tell how to increase timeout? – harshit Sep 28 '12 at 11:03
  • Try setting the `Binding.ReceiveTimeout` with http://msdn.microsoft.com/en-us/library/system.servicemodel.channels.binding.receivetimeout.aspx – Arun M Sep 28 '12 at 11:23
  • I am accessing webservice through WSDL. Am I supposed to change something in app.config ?? – harshit Sep 28 '12 at 11:29
  • WSDL is only contract about data format and service location. Timeouts are implementation specific. WSDL is not connected to this issue I assume. – ilvez Sep 28 '12 at 11:43
  • But isn't the timeout information is mentioned in app.config as I have mentioned in the change above – harshit Sep 28 '12 at 11:44

3 Answers3

0

If I understand you have timeout set less then 60 seconds or and your webservice just takes more time to process query and give response. Increase timout for request or optimize webservice.

Test with SoapUI, how long does it take for webservice to respond.

ilvez
  • 1,235
  • 3
  • 16
  • 27
  • yes, can't find much on it. To be honest I have little knowledge of this stuff and deployed it with google's help. Now where to increase timeout-> java side or client side. I am confused even on that. – harshit Sep 28 '12 at 11:12
  • Your client waits for service to answer. It waits 60 seconds and gets tired of wasting time and gives up with exception. Service may respond on 61 or 62 seconds but there is no one hearing the answer. You have to configure your client to wait longer. But as you don't know how much does it for webservice to process your avarage query, you don't know how long should be timeout for client. So you should test your webservice first, for example SoapUI. If timeout comes from webservice, then configure your WS. – ilvez Sep 28 '12 at 11:19
  • Thank you for your descriptive explanation. Can you please tell how to do ion client side. My client is a windows C# application and I am using WSDL to access the service. Am I supposed to change something in app.config file. I am pasting snippet of my app.config file in the question above. – harshit Sep 28 '12 at 11:27
  • I'm not the right person to answer C# specific stuff. However similar questions have been asked here you should search: http://stackoverflow.com/questions/11263127/how-to-increase-the-web-service-timeout-in-a-windows-service-application http://stackoverflow.com/questions/1205828/set-session-timeout-in-web-config – ilvez Sep 28 '12 at 11:41
0

Did not work on inputting any value in app.config file. However, it did work when I increased timeout value by hardcoding it:

DictionaryLookUp.EntityExtractionClient nlp = new 
                             DictionaryLookUp.EntityExtractionClient();
nlp.InnerChannel.OperationTimeout = new TimeSpan(0, 50, 0);
harshit
  • 3,788
  • 3
  • 31
  • 54
0

I was having a similar experience when setting a timeout to the value timeout="00:60:00". Its like the system is interpretating this as 0 seconds. If needed, set value to either "00:59:00" or "01:00:00"