Wednesday, 15 June 2011

Instruct WCF Service to return JSon -


I want to know that the WCF Web services return JSON data by default. And if any JSON can not back I can configure the most simple WCF web service.

Thanks in advance.

The easiest way I know is that the VS with WCF "AJX-enabled WCF service" template . In service (I VS 2008). This will give you boilerplate code for JSON-enabled WCF service.

Objects that take the form of logic and returns should be marked with the [datacentrite] attribute, and each property that you want to include in the JSON serialization marked with [datamember] And should have a waiter and setter (even if the setter does nothing).


No comments:

Post a Comment