I have the following method on a wcf web service.
[OperationContract]
[WebInvoke(Method = "POST",
ResponseFormat = WebMessageFormat.Json,
RequestFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.WrappedRequest)]
public void UpdateAnalysisParameters(string parameterSets)
{
//....
}
But I am having trouble posting data to it. I am using the following jquery Ajax call.
$.ajax({
url: "/ATOMWebService.svc/UpdateAnalysisParameters",
dataType: "json",
type: "POST",
data: JSON.stringify({ parameterSets: "Dave" })
});
But the web service is responding with "The incoming message has an unexpected message format 'Raw'. The expected message formats for the operation are 'Xml', 'Json'."
How can I post json data to this web service?