I want to make an ajax request in javascript to call WCF service, but I have an error : Access denied.
You can see the code below :
$("#test").on("click", function () {
$.ajax({
type: "GET",
url: 'http://localhost:1111/Design_Time_Addresses/WCFandEFServiceEnvol/PrestationService/Methode',
dataType: "json",
contentType: "application/json; charset=utf-8",
username: "CWS\jpado",
password: "Password",
success: function (prestaList) {
alert("success");
var prestaPicker = $("#Presta");
$(prestaList.d).each(function () {
prestaPicker.html(prestaPicker.html() +
"<p>" + this.id_prestation + "<\p>"
);
});
},
error: onError
});
});
I think the issue comes from the "username" because when I use debug, antislash \ (in the username) disappears after calling the ajax request.
I tried to use username: "CWS\\jpado", but it doesn't work (the both antislashes stay like that). I don't understand, because with another username (like bpepin for instance) the antislash doesn't disappear..
Edit : Do you know if '\j' is an escape characters ??
Sorry, I don't know if I well explain. Tell me if you want more informations.
Thanks !
EDIT : I edit adding two pictures
with username = '\j' I get 'j' after ajax request
with username = '\\j' I get '\\j' after ajax request
How can I get '\j' after ajax request ??
Thanks