Hi
I've got an ASP script that sends an XMLHTTP POST request to a server and gets a response. It was working perfectly until I called a script that caused my script to time out, which obviously means my entire script went down.
So I've tried to set it up so it sends it asynchronous and then loops until it has come back or 30 seconds has passed, whichever is first.
Set objXML = Server.CreateObject("MSXML2.XMLHTTP")
Response.Write itaggapi & "?" & params & "<br>"
objXML.Open "POST", itaggapi & "?" & params,true 'false
Response.write itaggapi & "?" & params
x = Time
objXML.send
do until objXML.ReadyState = "4" or time > x + 0.0003
loop
Response.write objXML.ReadyState
'Response.write objXML.responseText
if objXML.ReadyState = "4" then
'process the results
else
'state that there was a failure
end if
Everytime I set it to true for asynchronous it fails, everytime I set it to false it works fine. And when it fails the readystate is 1, when it succeeds it is 4.
Has anyone any idea what I am doing wrong?
Many thanks
I've got an ASP script that sends an XMLHTTP POST request to a server and gets a response. It was working perfectly until I called a script that caused my script to time out, which obviously means my entire script went down.
So I've tried to set it up so it sends it asynchronous and then loops until it has come back or 30 seconds has passed, whichever is first.
Set objXML = Server.CreateObject("MSXML2.XMLHTTP")
Response.Write itaggapi & "?" & params & "<br>"
objXML.Open "POST", itaggapi & "?" & params,true 'false
Response.write itaggapi & "?" & params
x = Time
objXML.send
do until objXML.ReadyState = "4" or time > x + 0.0003
loop
Response.write objXML.ReadyState
'Response.write objXML.responseText
if objXML.ReadyState = "4" then
'process the results
else
'state that there was a failure
end if
Everytime I set it to true for asynchronous it fails, everytime I set it to false it works fine. And when it fails the readystate is 1, when it succeeds it is 4.
Has anyone any idea what I am doing wrong?
Many thanks