Web Service / Javascript Issue

Please support our RSS, Web Services and SOAP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Sep 2006
Posts: 9
Reputation: rairai979 is an unknown quantity at this point 
Solved Threads: 0
rairai979 rairai979 is offline Offline
Newbie Poster

Web Service / Javascript Issue

 
0
  #1
Jul 3rd, 2008
Hi All,

I have just converted a few projects (Web Application, Web Service) to .Net 2005. The web application calls the web service using javascript from the client side.

I am getting Error 401 - Unauthorized Access. I understand how to get around this error on the server side (i.e. PreAuthenticate and set credentials to default credentials), but can't seem to get it working client-side.

Unfortunately, I cannot move this code to the server side - my dev manager wants it where it is.

Here is the javascript call:

PBService.useService("http://MyServer/PBWebservice/PBWebservice.asmx?WSDL","retVal");

PBService.retVal.callService(ParseXML, "MyFunction", document.getElementById("cnn").value, ID);

where cnn and ID are being passed to the web service as parameters.

Thanks for your help,

Rachel
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 21
Reputation: ratri is an unknown quantity at this point 
Solved Threads: 1
ratri ratri is offline Offline
Newbie Poster

Re: Web Service / Javascript Issue

 
0
  #2
Jul 10th, 2008
PBService seems to be a server side component and if so, you will not be able to use it in a javascript.

Instead you can use the XMLHttpRequest with javascript (AJAX to be precise) object to post date to your webservice and parse the response.

Search for XMLHttpRequest and you will get tonnes of code samples.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the RSS, Web Services and SOAP Forum


Views: 2100 | Replies: 1
Thread Tools Search this Thread



Tag cloud for RSS, Web Services and SOAP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC