consume web service - prompts for username and password

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hello All,
I have a simple custom web service that I put in the _vti_bin sharepoint folder. When I try to consume it using the following code:
<pre><script type="text/javascript
$(document).ready(function () {
$.ajax({
type: "POST",
url: "/_vti_bin/MyService.asmx/GetClients",
dataType: "json",
data: "{}",
contentType: "application/json; charset=utf-8",
success: function (data) {
var datafromServer = data.d.split(":");
$("[id$=txtClients]").autocomplete({
source: datafromServer
});
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert(textStatus);
}
});
});
</script>
[/code]

It always prompts for user name and password and fails on three attempts. Can anyone suggest me how to pre-authenticate the call to webservice.

View the full article
 
Back
Top