I created a WCF 3.5 application with a method called TestMe , as defined below:
[OperationContract] [WebInvoke(UriTemplate = "/Login", Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json)] MyDictionary<string, string> TestMe(string param1, string param2);
MyDictionary is created from this link: https://stackoverflow.com/a/464677/
Everything here works great. But the problem is returning data from the implemented method below:
MyDictionary<string, string> success = new MyDictionary<string, string>(); success["desc"] = "Test"; return success;
it returns the following json:
{"TestMeResult":{"desc":"Test"}}
while i need:
{"success":{"desc":"Test"}}
where success is the name of the object. What could be a workaround for this?
source share