Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
153 views
Welcome To Ask or Share your Answers For Others

1 Answer

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

client.InnerChannel.OperationTimeout = new TimeSpan(0, 5, 0);

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...