473,790 Members | 3,200 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 getWebServiceRe sultsAfterInit( ) {

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

var bDocument=false ;

var aszDocumentProg IDs=[ "MSXML2.DOMDocu ment.4.0",
"MSXML2.DOMDocu ment.3.0",
"MSXML2.DOMDocu ment",
"MSXML.DOMDocum ent",
"Microsoft.XmlD om"];

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

try{

objXmlDoc=new ActiveXObject(a szDocumentProgr amIDs[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.XMLH TTP"];
for (var i=0;!bHttp && i<aszHttpProgID s.length; i++){

try{

objHttp= new ActiveXObject(a szHttpProgIDs[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 1337
what's the point of these lines?

var aszDocumentProg IDs=[ "MSXML2.DOMDocu ment.4.0",
"MSXML2.DOMDocu ment.3.0",
"MSXML2.DOMDocu ment",
"MSXML.DOMDocum ent",
"Microsoft.XmlD om"];

for(var i=0;!bDocument && i<aszDocumentPr ogIDs.length; i++) {
your code should look like this:

var obj = new ActiveXObject(" Microsoft.XMLHT TP");
if(obj != null){
obj.Open('GET', 'webform1.aspx' +'?__COMMAND='+ command,false); obj.Send(); var
s = obj.responseTex t; 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*********@ya hoo.com> wrote in message
news:%2******** ********@tk2msf tngp13.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 getWebServiceRe sultsAfterInit( ) {

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

var bDocument=false ;

var aszDocumentProg IDs=[ "MSXML2.DOMDocu ment.4.0",
"MSXML2.DOMDocu ment.3.0",
"MSXML2.DOMDocu ment",
"MSXML.DOMDocum ent",
"Microsoft.XmlD om"];

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

try{

objXmlDoc=new ActiveXObject(a szDocumentProgr amIDs[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.XMLH TTP"];
for (var i=0;!bHttp && i<aszHttpProgID s.length; i++){

try{

objHttp= new ActiveXObject(a szHttpProgIDs[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
3267
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 properly. I was trying to use such code: <script lang="javascript"> function handleOnReadyStateChange() { if (this.readyState==4) {
9
5584
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, using the same HTML/JS it always returns no data (xmlhttp.responseText is null). When I try to get headers using Mozilla or display the http status code I get some obscure exception in the javascript console that I've given up on searching for an...
12
13811
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 to the web server of our company which is redhat 9 i still have no problem with mozilla but the ie gives an error like this, System error: -1072896658
1
4938
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, which is the file I am programmatically rewriting to elsewhere) gets changed. I am trying to use AJAX and JSON to do this. I have copied an example of using HttpRequest Object as the backbone of this from...
5
2816
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). Is there a way to display the content of xmlhttp.responseText on a new page?? I tried document.write(xmlhttp.responseText) but this does not display the XML structure.
9
2383
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 with netscape,I dont know how to pass the xmlhttp request in Netscape. i got some code like below for netscape for xmlhttp var oXML=new XMLHttpRequest();
1
14558
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") xmlhttp.setRequestHeader "Content-type","text/txt" xmlhttp.Open "get", "http://www.mysite.com/default.asp", False xmlhttp.Send text = xmlhttp.responseText dim fs, fname
13
25331
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 the version of Microsoft's XML parser and that Microsoft.XMLHTTP refers to the latest installed version. This makes me wonder why sites like <http://developer.apple.com/internet/webcontent/xmlhttpreq.htmlopt to use Msxml2.XMLHTTP, first, and...
21
3900
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 this property or method'. <form name="myform" action="main.asp" method="post"> <div id="content"> <h2 id="pageName">Main Page</h2> <div class="feature"> <h1>Surfing the intranet </h1> <p> This is a comprehensive information...
2
12472
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" xmlHttp.onreadystatechange=stateChanged
0
9666
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10201
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10147
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9987
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9023
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7531
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5552
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4100
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2910
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.