473,231 Members | 1,619 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,231 software developers and data experts.

Reading Web Service Response with Javascript

Hello
im trying to do an http post via javascript to my web service i can view the
xml response but cant seem to get null objects when i use an xpath with it :?
heres my code. I appreciate any help i can get
<script language=javascript type="text/javascript">
function postdata(){
var url="http://localhost:3601/WebSite2/hint.asmx/hint";
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
xmlHttp.open('POST', url , true);
xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xmlHttp.send("Term=e");
xmlHttp.onreadystatechange = checkState;
}
function checkState(){
if(xmlHttp.readyState=="complete"||xmlHttp.readySt ate==4){
placeHint(xmlHttp.responseText);
//I've tried using resoponseXML as well but the response is the same
}
}
//THIS IS WHERE THE PROBLEM IS
function placeHint(xmlresponse) {
oDoc =new ActiveXObject("MSXML2.DOMDocument.4.0")
oDoc.async = false;
var sNamespaces = "xmlns:ph='http://microsoft.com/webservices/'";
oDoc.setProperty("SelectionNamespaces",sNamespaces );
oDoc.load(xmlresponse)
resultNode = oDoc.selectSingleNode("/*/ph:string").text;
alert(resultNode);
}
Jul 1 '06 #1
0 1086

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

Similar topics

3
by: Casper Hornstrup | last post by:
I have an ASP.NET application that imports product descriptions from an Excel file. The Excel file is uploaded, then a background thread will start importing the product descriptions from the Excel...
2
by: shadow.demon | last post by:
So ajax is the new black, i've had a couple ideas about how to implement it. I've alook at ajax.net and few other implementations but to me they're a bit complex. Maybe it's the way to go to have...
1
by: evilme | last post by:
greetings and salutations, o smarter than i. i've been working on a solution to secure the delivery of pdfs to client browsers. we're introducing an public-website element, so i've decided to use...
3
dmjpro
by: dmjpro | last post by:
plz send me a good link which can clearify me how the J2EE framework works i want the details information .... plz help thanx
1
by: jeewant | last post by:
Hi, I am creating web service for my company. The web service supposed to pop up windows (web page with url address and unique id) after the user is validated. I did the user authentication part...
2
by: Jaweed Sheikh | last post by:
Actually iam consuming a web service from traditional ASP and trying to read the XML from Javascript. Will appriciate any quick help. Here is the code <% If...
0
terryble
by: terryble | last post by:
hy, We are deploying IPPhone cisco(R) On this phone proprietary code exist with XML too. After code modification, a can't find the final step for this service to work. I need to post the variable...
4
by: jake | last post by:
Can someone please give me an example on how to call a wcf method that resides on a different domain from JavaScript (not from C#/asp.net)? All the examples that I have seen show how to call from...
2
by: Steven Cheng | last post by:
Hi Gary, As for the setting you mentioned, it is used to custimze the received data size limitation of WCF binding(such as NetTcpBinding or HttpBinding). After you have definite a customized...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...

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.