WebMethods expects a string containing JSON to be parsed on the server side, I use the JSON.stringify function to convert the parameter object to a string and send data, I have this function:
jQuery.executePageMethod = function(location, methodName, methodArguments, onSuccess, onFail) { this.ajax({ type: "POST", url: location + "/" + methodName, data: JSON.stringify(methodArguments), // convert the arguments to string contentType: "application/json; charset=utf-8", dataType: "json", success: function(data, status) { var jsonData = JSON.parse(data.d); onSuccess(jsonData, status); }, fail: onFail }); };
I recommend that you include the json2.js analyzer in your pages so that you can use the cross-browser JSON.stringify.
CMS
source share