I am trying to call a webservice on my local host which expects a parameter pkId and return the result. WebService runs perfect but when i call from JQuery, it does not return any data. I have tried almost all combinations to set parameter for the Web service (data) part but unable to get any result and the real pain is i don't get any error.
$.ajax({
type: "POST",
url: "http://localhost/WSTest/Service.asmx/AuthorGetById",
data: "{pkId :'" + pkId + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
return msg.d;
}
});
This is not an answer but means to help you reach there.
Even if you have an error you wont get it since you have not handled error at all.
Also worth while to check if your msg has 'd' since its a ASP.NET 3.5+ feature.
Also, dont return msg.d try to alert it.
A sample will be