I can't seem to succeed with getting JSON out of a WCF service even if I tag the method with the attributes:
[WebGet(UriTemplate = "Product/{productIdString}",
ResponseFormat = WebMessageFormat.Json)]
OR
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
I'm always getting XML, whether I return it as a DataSet
or a List<>
.
The only way that worked was to manually returning JSON as a string but it was also encapsulated in XML.
Any clue?