Select the product you need help with
The request that is sent by the HttpWebRequest class may stop responding when you use the HttpWebRequest class in an ASP.NET applicationArticle ID: 904262 - View products that this article applies to. SYMPTOMSWhen you use the HttpWebRequest class in a Microsoft ASP.NET application, the request that is sent by the HttpWebRequest class may stop responding. CAUSEThis behavior may occur when the HttpWebRequest class and the HttpWebResponse class are used to make a HTTP or HTTPS request from an ASP.NET page and the ASP.NET page times out before the request is finished. When the ASP.NET page times out, the request is aborted. The aborted request may leave the connection that was initiated by the HttpWebRequest class in an unknown state and may cause the request to fail. Note Managed code classes such as SOAP and remoting internally use the HttpWebRequest class. Therefore, managed code classes may exhibit the same behavior. WORKAROUNDTo 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:
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 STATUS This behavior is by design. REFERENCESFor more information, see the following Microsoft Developer Network (MSDN) Web sites: <httpRuntime> element http://msdn2.microsoft.com/en-us/library/e1f13641(vs.71).aspx
(http://msdn2.microsoft.com/en-us/library/e1f13641(vs.71).aspx)
HttpWebRequest.Timeout property http://msdn2.microsoft.com/en-us/library/system.net.httpwebrequest.timeout(vs.71).aspx
(http://msdn2.microsoft.com/en-us/library/system.net.httpwebrequest.timeout(vs.71).aspx)
HttpWebRequest.ReadWriteTimeout property http://msdn2.microsoft.com/en-us/library/system.net.httpwebrequest.readwritetimeout(vs.71).aspx
(http://msdn2.microsoft.com/en-us/library/system.net.httpwebrequest.readwritetimeout(vs.71).aspx)
PropertiesArticle ID: 904262 - Last Review: May 21, 2007 - Revision: 1.5
|


Back to the top








