I have created one wcf and is running locally in my machine. In the same project i have created a html page calling this wcf web service using ajax.
$.ajax({
type: "POST",
url: "wbsvc.svc/calendar",
contentType: "application/json; charset=utf-8",
dataType: "jsonp",
processData: false,
success: function (msg) {
var data = msg.d;
console.log(data);
},
error: function (msg) {
console.log(msg);
}
});
calendar is the method in webservice. Error is
Failed to load resource: the server responded with a status of 400 (Bad Request) in wcf using ajax http://localhost:65029/wbsvc.svc/calendar?callback=jQuery110108707461392041296_1379052209564
What i am missing here.
Interface is
[OperationContract]
[WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
Model.calenderinfo[] calendar();