User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the RSS, Web Services and SOAP section within the Web Development category of DaniWeb, a massive community of 423,353 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 5,153 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our RSS, Web Services and SOAP advertiser: Programming Forums
Views: 1173 | Replies: 1
Reply
Join Date: Sep 2006
Posts: 9
Reputation: rairai979 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
rairai979 rairai979 is offline Offline
Newbie Poster

Web Service / Javascript Issue

  #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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jul 2008
Posts: 21
Reputation: ratri is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
ratri ratri is offline Offline
Newbie Poster

Re: Web Service / Javascript Issue

  #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  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb RSS, Web Services and SOAP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

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

All times are GMT -4. The time now is 12:01 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC