XMLHTTP -help

K

Kapil Shah

Hello everybody,
I am trying to develop code to use the correct version of XMLHTTP before
using it to send SOAP envelope to WebService . The code I have written
is as follows,

function getWebServiceResultsAfterInit() {

// Must be using IE for this to work
if(window.ActiveXObject){
// Create the XML Document object

var bDocument=false;

var aszDocumentProgIDs=[ "MSXML2.DOMDocument.4.0",
"MSXML2.DOMDocument.3.0",
"MSXML2.DOMDocument",
"MSXML.DOMDocument",
"Microsoft.XmlDom"];

for(var i=0;!bDocument && i<aszDocumentProgIDs.length; i++) {

try{

objXmlDoc=new ActiveXObject(aszDocumentProgramIDs);
bDocument=true;
}catch (objException){



}

} // End of For Loop

// Create the XML HTTP object
var bHttp= false;

var aszHttpProgIDs=["MSXML2.XMLHTTP.4.0",
"MSXML2.XMLHTTP.3.0",
"MSXML2.XMLHTTP",
"Microsoft.XMLHTTP"];


for (var i=0;!bHttp && i<aszHttpProgIDs.length; i++){

try{

objHttp= new ActiveXObject(aszHttpProgIDs);
bHttp=true;
} catch (objException) {

// error handling elided for clarity

}


}// End of For Loop

if(!bDocument ||!bHttp){
throw "MSXML not found on your computer.";

return;

}


However the code is not running and the error I am getting is Exception
thrown but not caught.. I am getting lost.. WOuld really appreciate it
if somebody helps me.

Thanks in advance..

Kapil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,710
Latest member
bernietqt

Latest Threads

Top