tags:

views:

1439

answers:

3

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>

Still I am getting the same error!

What is the solution?

Thanks in advance

A: 

As the error message says

Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding.

If you are having problems with this post your client binding config

olle
+7  A: 

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>
Harry
Sounds like you are quite new to WCF. http://msdn.microsoft.com/en-us/library/ms731067.aspx for some great tutorials
Harry
Timeout errors are almost never resolved by increasing the timeout. They are generally caused because the client is unable to connect to the server. The timeout only exists so that you don't wait hours or days before giving up.
Kirk Broadhurst
if it is the client waiting on a long running task, then 60 seconds isn't particularly long. and quite likely the easiest fix.
Harry
A: 

Firstly, you also need to to change your client side config. There are a number of timeout attributes that you can configure. Check these, although normally the default timeout values will suffice.

You will often get this issue if you can't connect to the service, e.g. it is behind a firewall or similarly inaccesible. I have experienced this message when http ports are open, so that I can browse to the service, but net-tcp ports are blocked, so that I cannot 'use' the service.

If the service is definitely available and you are still getting this issue, check whether you can connect to the server on the required port.

Kirk Broadhurst
In my experience this issue will only be resolved by increasing the timeout if you are transferring a lot of data. If you are just retrieving small data then it will be another issue. The timeout is being exceeded because nothing is happening within the timeout, and increasing the timeout will only make you wait longer for the exception to occur.
Kirk Broadhurst