What are the exceptions? They may be meaningless to you, but some one around here might find them helpful in diagnosing your problem. I use jQuery to make ajax request to a WCF service and the settup usually looks like this:
$(document).ready(function() {
$.ajaxSetup({
type: "POST",
processData: true,
contentType: "application/json",
timeout: 5000,
dataType: "json"
});
var data = { "value": 5 };
AjaxPost("GetData", data, OnEndGetData, OnError);
});
function OnEndGetData(result) {
alert(result.GetDataResult);
}
function OnError(msg) {
alert(msg);
}
function AjaxPost(method, data, callback, error) {
var stringData = JSON.stringify(data);
var url = "Service1.svc/" + method;
$.ajax({
url: url,
data: stringData,
success: function(msg) {
callback(msg);
},
error: error
});
}
The JSON.stringify() can be found in the json.org script: http://www.json.org/js.html, and my sig for GetData method looks like this:
[OperationContract]
[WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
string GetData(int value);