tags:

views:

287

answers:

2

Might seem like a silly question, but everything in WCF seems a lot more complicated than in asmx, how can I increase the timeout of an svc service?

Here is what I have so far:

<bindings>
      <basicHttpBinding>
        <binding name="IncreasedTimeout" 
          openTimeout="12:00:00" 
          receiveTimeout="12:00:00" closeTimeout="12:00:00"
          sendTimeout="12:00:00">
        </binding>
      </basicHttpBinding>
</bindings>

And then my endpoint gets mapped like this:

<endpoint address="" 
  binding="basicHttpBinding" bindingConfiguration="IncreasedTimeout"
             contract="ServiceLibrary.IDownloads">
             <identity>
                <dns value="localhost" />
             </identity>
          </endpoint>

The exact error I am getting:

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

In the WCF Test Client, there is a config icon that contains the run time configuration of my service:

As you can see its not the same values as I've set for it? What am I doing wrong?

<bindings>
            <basicHttpBinding>
                <binding name="BasicHttpBinding_IDownloads" 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="">
                            <extendedProtectionPolicy policyEnforcement="Never" />
                        </transport>
                        <message clientCredentialType="UserName" algorithmSuite="Default" />
                    </security>
                </binding>
            </basicHttpBinding>
        </bindings>
+2  A: 
marc_s
I've tried to add the binding sections to <system.serviceModel> in web.config, but its throwing an error now.... any additional steps I've missed out on...
JL
I also changed the endpoint in my service to the <endpoint address="" binding="IncreasedTimeout" - is this the wrong thing to do?
JL
I think I get it - binding="basicHttpBinding" bindingConfiguration="IncreasedTimeout"
JL
exactly - the binding is the type of protocol you use - basicHttp, wsHttp, netTcp. The binding **configuration** is this configuration you create in config to modify timeouts etc.
marc_s
Funny even after doing this, still getting a timeout error, Marc can you please give as much information as possible?
JL
Tried to add more info - what exception exactly are you getting? Can you post the exception message and a possible InnerException (if there's one)?
marc_s
A: 

The timeout configuration needs to be set at the client level, so the configuration I was setting in the web.config had no effect, the WCF test tool has its own configuration and there is where you need to set the timeout.

JL
well, yes - typically, it has to be set both on the client and the server, even - e.g. in case of "inactivityTimeout" on sessions and things like that.
marc_s