REST service does not get POST payload
I have a big problem. I created a WCF service.My POST declaration looks like this:
[OperationContract] [WebInvoke(UriTemplate = "json/put", Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)] string PutData(string jsonText);
I was expecting that when I'm sending data (I'm using fiddler2 to test it) that it will automaticly "put" into the jsonText variable. The service works, but there is no data :(.
Can anybody help? The whole project
WCF expects the JSON payload to be deserialized into a type. Try creating a class that is shaped like your JSON payload and use that as the parameter type.