Wednesday, 20 November 2013

How to Increase Timeout on WCF Service


Hi,

There are Four timeouts in binding section.

Exception 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.
 
This kind of Timeout issues come if the Service taking more time to respond.
In web.config, at your Service Binding configuration there are 4 timeout values are there,



<wsHttpBinding>
       <binding name="WSHttpBinding_IListService" closeTimeout="00:01:00"
          openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00">
   </binding>
      </wsHttpBinding>


Here the most important thing is sendTimeout, which says how long the client will wait for a response from your WCF Service. we can specify the tome in  hours:mintes:seconds in your binding section, one thing we need to know by default the timeout is 1 minute only. This will Include a time request-receive.

The openTimeout as the amount of time you are willing to wait when you open the connection to your WCF service.

The
closeTimeout as the amount of time when you close the channel dispose the client proxy.

The
receiveTimeout is same like a sendTimeout, While the sendtimeout is the amount of time you will wait for a Response from the Server, the receiveTimeout is the amount of time you will give to your client to receive and Process the response from the Server.

The receivetimeout is used to intialize serverside session timeout.

In this Exception case we need to Increse the sendTimeout.


Resource: MSDN

No comments:

Post a Comment