Problem :timeout Error while using MSXML2.ServerXMLHTTP

Problem :timeout Error while using MSXML2.ServerXMLHTTP

I am using MSXML2.ServerXMLHTTP to access a web page which is located on another machine(localwebserver),trying to send XML request  & accept the response

During the “Send” I get the following error.

“Error Type:
msxml3.dll (0x80072EE2)
The operation timed out
/pmstest/abc.asp, line 100”

The asp code is as follows:

Dim objXmlHTTP
Dim objXmlDOM
Set objXmlDOM =Server.CreateObject(“Microsoft.XMLDOM”)
objXmlDOM.async=false
objXmlDOM.loadXML(strPostXml)
Set objXmlHTTP = Server.CreateObject(“MSXML2.ServerXMLHTTP”)
objXmlHTTP.setOption 1, true
objXmlHTTP.Open “POST”, Session(“strLocalWebServerPath”) & “/data_pulling.asp”, true
objXmlHTTP.send(strPostXml)
While (objXmlHTTP.readyState<>4)
objXmlHTTP.waitForResponse(10000)
Wend

The error is shown on the line containing the code for objXmlHTTP.send(strPostXml).

This error occurs occasionally. after multiple quick attempts.

If objXmlHTTP.Open last parameter is set to False, the error is as follows
error:-Error Type:
msxml3.dll (0x80072EF1)
The operation has been canceled
/pmstest/abc.asp, line 100

Pls help.


Solution: timeout Error while using MSXML2.ServerXMLHTTP

Reading the Status property won’t help with timeouts because XMLHTTP will keep waiting for a response until a timeout occurs – Status simply tells you the status at any given point.

The correct way to handle timeouts is to use the SetTimeouts method to set various timeouts (connection, data transfer etc).

After setting the timeout values you request the page THEN check the Status, responseText or responseXML properties to determine whether or not the connection was successful.