In the previous article, we discussed how to resolve the Timeout Expired issue in SQL Server. Today, let’s look at another network problem.
Problem Description
The Winform client experiences a 120-second timeout when calling the Webservice.
How to Troubleshoot and Webservice Timeout Issues?
For this issue, timeout settings of 300 seconds were configured separately for the server and client:
Server-Side Timeout Setting
Add the following configuration to the system.web section of web.config:
<httpRuntime executionTimeout="300000" />
Remember to turn off debug mode in web.config
:
<compilation defaultLanguage="c#" debug="false" />
Client-Side Timeout Setting
Set the request timeout in the WebService client proxy program (generated using wsdl.exe), in milliseconds:
protected override WebRequest GetWebRequest(Uri uri)
{ HttpWebRequest wr = (HttpWebRequest)base.GetWebRequest(uri); wr.Timeout = 300 * 1000; return wr; }
However, a 120-second timeout still occurs so conclusions can be drawn as follows:
1. It might be a server issue.
2. It might be a client .NET environment configuration issue.
3. It might be a domain issue.
4. It might be a network issue.
For this, the following tests were conducted:
1. Changing Client Computers: Some computers experienced timeouts while others did not. It is confirmed that the server is not the issue.
2. Checking Client Computer Configurations: No issues were found with the configurations on multiple client computers.
3. Within the Same Domain: Some computers did not experience timeouts while others did, so domain issues can be ruled out.
4. Network Issues: Router settings for various network segments were checked, but no problems were found.
After these tests, it seemed all potential issues were ruled out. Could it be an MS bug? A search online yielded no results. Reflecting on the Webservice principles: client and server wrap requests and data results in XML via SOAP and transmit them using HTTP, enabling interaction.
Given the Webservice principles, it must be an HTTP timeout issue. The router settings and network are fine. Could it be an IE version problem? The issue became clearer when checking IE’s proxy settings—there was a proxy set, which seemed to be causing the timeout. Final testing revealed that the root cause was the proxy timeout setting of 120 seconds.
Summary
For Webservice timeout issues, first address programmatic settings such as web.config and client timeout settings. If timeouts persist, investigate Webservice principles and HTTP-related issues, including network problems, IE proxy settings, and other network configurations that might cause timeouts.