Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Time out issue in WCF

Tags:

c#

wcf

I am having time out issue in WCF.

The following is the error:

{"The request channel timed out while waiting for a reply after 00:00:59.9843744. 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."}

After searching in google, I found the solution

from this site

http://social.msdn.microsoft.com/Forums/en-US/peertopeer/thread/38306972-3128-4f0c-937b-5d162d4d8e74

So I changed accordingly my app.config file

<behavior name="ContactServiceBehaviour">
  <serviceMetadata httpGetEnabled="true" />
  <dataContractSerializer maxItemsInObjectGraph="1000000000"/>
  <serviceDebug includeExceptionDetailInFaults="true" />
  <serviceThrottling    maxConcurrentCalls="100"
                      maxConcurrentSessions="100"
                      maxConcurrentInstances="100"/>
</behavior>

What is the solution?

like image 677
priyanka.sarkar Avatar asked Aug 27 '09 13:08

priyanka.sarkar


People also ask

What is WCF timeout?

The openTimeout as the name implies is the amount of time you're willing to wait when you open the connection to your WCF service. Similarly, the closeTimeout is the amount of time when you close the connection (dispose the client proxy) that you'll wait before an exception is thrown.


1 Answers

The forum post you mention is a red herring. The error message clearly states that you need to increase the timeout property in the WCF client and service. (if you change it in the service I have found that it doesn't always get picked up by the client when it is updated)

In Visual studio goto the Tools menu, there you will find the 'WCF Service Configuration Editor'. Load your projects web.config and define a new Binding for your service.

The setting to change is the SendTimeout value. It is 60 seconds by default.

<system.serviceModel>
<bindings>
  <basicHttpBinding>
    <binding name="WCFBinding" sendTimeout="00:02:00">
    </binding>
  </basicHttpBinding>
</bindings>
like image 137
Andrew Harry Avatar answered Sep 30 '22 03:09

Andrew Harry