DOM
Expand Minimize

waitForResponse Method

Allows the requesting server to suspend execution while waiting for an asynchronous send operation to complete.

oServerXMLHTTPRequest.waitForResponse(timeoutInSeconds);
timeoutInSeconds(optional)

Specifies the number of seconds to wait for an asynchronous send operation to complete.

var xmlServerHttp = new ActiveXObject("Msxml2.ServerXMLHTTP.6.0");
xmlServerHttp.open("GET", "http://localhost/sample.xml", true);
xmlServerHttp.send();
while (xmlServerHttp.readyState != 4) {
   xmlServerHttp.waitForResponse(1000);
}


timeoutInSeconds(optional)

Specifies the number of seconds to wait for an asynchronous send operation to complete.

timeoutInSeconds [in, optional]

Specifies the number of seconds to wait for an asynchronous send operation to complete.

isSuccessful [out, retval]

The waitForResponse method is more efficient than polling the readyState property, which is the only way to wait for an asynchronous send using the XMLHTTP component. The caller can supply an optional timeout parameter, specified in seconds. The default timeout (if one is not specified) is INFINITE (-1). The method returns True if a response is received within the time allotted, or False if a timeout occurs. If the method times out, the request is not aborted; the caller can continue to wait for the request in a subsequent call to the waitForResponse method. Calling waitForResponse after a synchronous send method returns immediately and has no useful effect. The async parameter to the open method controls whether the send is synchronous (default) or asynchronous. The results of this method are valid only after the send method has been completed successfully.

S_OK

The value returned if successful.

Implemented in: MSXML 3.0 and MSXML 6.0

Show:
© 2014 Microsoft. All rights reserved.