Search code examples
wcftimeout

Timeout parameter at WCF web.config file does not affect/work on server


I have a WCF project. I am calling X service from my WCF service. When I call this X service it is waiting and responds after 3 minutes.

I want to increase timeout because default is 1 minute. When I add the config shown below to my local environment, it works.

But when I deploy this to the test environment, it is not working and I am getting timeout.

web.config:

<binding name="WSHttpBinding_ISyncReply" 
         openTimeout="00:01:00" closeTimeout="00:01:00"
         receiveTimeout="00:10:00" sendTimeout="00:10:00">

I even added this config here to code behind, but it did not work either:

((IContextChannel)compClient.InnerChannel).OperationTimeout = new TimeSpan(0, 30, 0);

Solution

  • In my opinion, the reason may be that the binding configuration has not been applied to the client-side. try to add the binding configuration name to the client endpoint.
    https://learn.microsoft.com/en-us/dotnet/framework/wcf/feature-details/configuring-timeout-values-on-a-binding
    Besides, Are you sure that changing the client configuration will remove the timeout limit? I think we’d better change the binding configuration from the server.