29

I have a web service written in C# that is living on a SharePoint site. I have modified the web.config with the following code:

<configuration>
  <system.web>
    <httpRuntime executionTimeout="360" />

...

for the IIS Inetpub file, the SP ISAPI web.config file and the SP layouts web.config. I have also modified the machine.config file with the same code and tried to bump any timeouts that I see in IIS.

When I call this web service from a Windows C# application I can step into the web method and start debugging the variable but after a short time (~1 minute, maybe less) the variable values are no longer present because this gets returned:

System.Net.WebException "The request was aborted: The operation has timed out."

I am trying to figure out where the correct timeout values needs to be set and how. I restart IIS after I have made every change but nothing changes to give different results.

Thanks

2 Answers 2

33

After creating your client specifying the binding and endpoint address, you can assign an OperationTimeout,

client.InnerChannel.OperationTimeout = new TimeSpan(0, 5, 0);
Sign up to request clarification or add additional context in comments.

3 Comments

When I attempted this it didn't seem to make any difference
private void SetRequestTimeout(IClientChannel client) { if (client != null) { client.OperationTimeout = new TimeSpan(0, TIMEOUT_EXPIRE_IN_MIN, 0); } }
doing it this way? it should set the timeout.
25

Try setting the timeout value in your web service proxy class:

WebReference.ProxyClass myProxy = new WebReference.ProxyClass();
myProxy.Timeout = 100000; //in milliseconds, e.g. 100 seconds

7 Comments

you are right....I updated my answer. Did you try setting the time out value on the proxy class?
can you clarify where you are suggesting to do this? I have the web service instantiation but I don't see any properties for ProxyClass, just Proxy... thanks
This change would be implemented in the C# windows application. It would be part of the web reference to your web service.
Looks like it might have been the App Pools timeout setting in IIS it was set to 90 seconds. I had modified every web.config I could find and machine.config and nothing worked
Seconds or milliseconds? And 100 seconds are 100000 milliseconds, you've missed a zero...
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.