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
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