473,395 Members | 1,532 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

XMLHTTP-Pls help


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[i]);
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[i]);
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
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #1
1 1309
what's the point of these lines?

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++) {
your code should look like this:

var obj = new ActiveXObject("Microsoft.XMLHTTP");
if(obj != null){
obj.Open('GET','webform1.aspx'+'?__COMMAND='+comma nd,false); obj.Send(); var
s = obj.responseText; alert(s)
} else alert('Unable to create client object');

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Kapil Shah" <kr*********@yahoo.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...

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[i]);
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[i]);
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
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Krzysztof Kubiak | last post by:
I'm trying to make use of XMLHTTP object, but I've come across a problem. It seems that there is no way to create dynamic array of such XMLHTTP objects (to make several requests) and handle them...
9
by: fochie | last post by:
Greetings, I'm having a problem when I try to GET a file from my server via xmlhttp when using Mozilla. With IE I can get any type of file fine, get/display headers fine, etc. With Mozilla,...
12
by: Botan Guner | last post by:
Hi all, Here is the problem, i'm using Microsoft.XMLHTTP for ie and XMLHttpRequest for mozilla, on my local server which is win2000 server i've no problem with that but when i uploaded the file...
1
by: Ike | last post by:
Ive copied an online example for writing out a php file, programmatically, then would like to re-display that data in a browswer window that automatically refreshes as the data file (getdata.php,...
5
by: hatsumoto | last post by:
Hello, I create an ActiveXObject("Msxml2.XMLHTTP") from my HTML page to submit (i.e. post) XML to a server. I can see the content of the XML response via javascript alert(xmlhttp.responseText)....
9
by: balakrishnan.dinesh | last post by:
hi friends, Exactly what i want to know is, In my product we are using xmlhttp request to retrive some data from the server, And Im using IE browser, its working fine in IE. Now i want to work...
1
by: cwl | last post by:
I want to get the content of a webpage containing plain text and write the content to a text file. My code looks like this: Set xmlhttp = CreateObject("Microsoft.XMLHTTP")...
13
by: yawnmoth | last post by:
<http://www.quirksmode.org/book/printable/xmlhttp.txtshows two alternatives to Microsoft.XMLHTTP - Msxml2.XMLHTTP and Msxml3.XMLHTTP. If my understanding is correct, the different numbers refer to...
21
vikas251074
by: vikas251074 | last post by:
I am getting error while entry in userid field. When user enter his user id, an event is fired immediately and user id is verified using AJAX method. But I am getting error 'Object doesn't support...
2
by: trpost | last post by:
Is it possible to execute javascript as passed in xmlHttp.responseText Here is what I am doing: search.js var xmlHttp xmlHttp=GetXmlHttpObject() var url="search.php"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.