To work around this behavior, you must make sure that the ASP.NET time-out value is large enough to handle sending the request with the
HttpWebRequest.GetResponse method and reading the response stream that is retrieved by using the
HttpWebResponse class.
Note The HTTP request is made up of the following parts:
- Sending the request is covered by using the HttpWebRequest.Timeout method.
- Getting the response header is covered by using the HttpWebRequest.Timeout method.
- Reading the body of the response is not covered by using the HttpWebResponse.Timeout method. In ASP.NET 1.1 and in later versions, reading the body of the response is covered by using the HttpWebRequest.ReadWriteTimeout method. The HttpWebRequest.ReadWriteTimeout method is used to handle cases where the response headers are retrieved in a timely manner but where the reading of the response body times out.
You set the ASP.NET time-out value in the web.config file or in the machine.config file that uses the
executionTimeout property in the
<httpRuntime> section.
Note If the
debug property in the .config file is set to
true, the
executionTimeout property is ignored.
You must set the ASP.NET
executionTimeout setting to a value that is larger than or equal to the value that is determined by the following formula:
(HttpWebRequest.Timeout * 2) + HttpWebRequest.ReadWriteTimeout