Jump to content

MSXML 4 error: This method cannot be called after the send method.


Recommended Posts

Guest Phil_M
Posted

Hi All,

 

I am using MSXML2.ServerXMLHTTP.4.0 (MSXML4.DLL v4.20.9841.0) in "classic"

ASP to Post a request from one IIS web site to another. The sites are located

on the same server. There are times when my XMLHTTP.send() command (and

sometimes other commands) fails with the error: "This method cannot be called

after the send method has been called". The error is caught in the JScript

code's "catch" block.

 

I have a JS file that contains the object declaration and the code that uses

it. This object/code is then used by a number of different pages and

processes. The order of steps in the code are:

 

//------------------------------------------

// Define/Declare it

var m_XMLHTTP;

try {

m_XMLHTTP = new ActiveXObject( "MSXML2.ServerXMLHTTP.4.0" );

var lResolve = 20 * 1000;

var lConnect = 60 * 1000;

var lSend = 30 * 1000;

var lReceive = 35 * 1000;

m_XMLHTTP.setTimeouts(lResolve, lConnect, lSend, lReceive);

} catch(er) {

logServerError2(er, 'cannot create the m_XMLHTTP object')

m_XMLHTTP = 0;

}

 

// Open it

m_XMLHTTP.open("POST", sURL, bAsync);

 

// Set the request header for IE compatability

m_XMLHTTP.setRequestHeader('content-type','application/x-www-form-urlencoded');

 

// Define an event handler for processing

m_XMLHTTP.onreadystatechange = xmlhttpReadyState;

 

// Send the XMLHTTP request to the back end

m_XMLHTTP.send(sPostData);

//------------------------------------------

 

It has worked properly the majority of the time, but sometimes I get this

error numerous times in succession. I have an ASP page that includes an HTML

object containing Windows Media Player 9.2. I am playing a variety of .mpg

files in Media Player based on a back-end process that tells me which one to

play.

 

I use the same m_XMLHTTP process to log application activities and status to

a text file. The error only seems to occur during times when there are a

number of calls (3 to 4) made in very close succession (within 0.5 seconds or

less time). As noted above, the call works the majority of the time, but

sometimes I get this error. I have been unsuccessful in finding the cause of

the error and what to do to fix it. Any suggestions or recommendations are

appreciated.

 

Thanks very much,

 

Phil M.

  • Replies 0
  • Created
  • Last Reply

Popular Days


×
×
  • Create New...