How can I accept arbitrary JSON objects in my REST WCF service?
问题 I want to implement a service method like this: [OperationContract] [WebInvoke(RequestFormat = WebMessageFormat.Json, ResponseFormat=WebMessageFormat.Json)] public void MakeShape(string shape, string color, IDictionary<string, object> moreArgs) { if (shape == "circle") { MakeCircle(color, moreArgs); } } My clients POST objects like: { "shape":"circle", "color": "blue", "radius": 42, "filled":true, "annotation": {"date":"1/1/2012", "owner":"George"} } At the call to MakeCircle, moreArgs would