Hi there,
I'm implementing a generic restful api in WCF. I require access to a generic object deserialized from JSON (as a parameter to a POST operation). I'm using the raw programming model to permit fine-grained control of the return format. For example:
// Create
[OperationContract(Name = "CreateJSON")]
[WebInvoke(UriTemplate = "{endpointName}", Method = "POST", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
Stream Create(Object input, String endpointName);
In the above example the generic object is given by the parameter 'input' that I expect to be the POST payload. An analogous call works fine with an endpoint targeted for xml, but not JSON.
Any ideas/assistance would be greatly appreciated. Anyone?