Tuesday, February 26, 2008

C# Web Service Timeout

Make sure you set the Timeout to "-1" for 'infinite", otherwise you may end up with timeout errors at any point in your application that calls the service.

C# Code
MyWebService.WebService webService = new MyWebService.WebService();
webService.Url = ConfigurationManager.AppSettings["WebService.URL"];
webService.Timeout = Int32.Parse(ConfigurationManager.AppSettings["WebService.Timeout"]);

<add key="WebService.URL" value="http://myserver.com/MyWebService.asmx">
<add key="WebService.Timeout" value="-1">

No comments:

Check This Out!

More Links to Good Information