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.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,


10 Years
Discussion Span
Last Post by ratri

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.