XMLHTTP

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
 
M

Marina

I would guess that is because you are explicitly throwin an exception in
that last 'if' statement, but you are not catching it anywhere.

Also, I wouldn't say this is an ASP.NET question per say, more like
javascript.
 
B

bruce barker

you misspelled aszDocumentProgIDs in

objXmlDoc=new ActiveXObject(aszDocumentProgramIDs);

also, when xp-sp2 is installed, this code will require a high security
setting.

note: soap call support is builtin with netscape/mozilla
 

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,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top