I am creating a WCF Service. There are multiple Operation Contract for the service. Among them, only one [Operation Contract] will be as JSON data.
For Example:--- Service Name: IAdmin.cs
[OperationContract]
DataSet GetReport(int userID);
[OperationContract]
[WebInvoke(Method="GET", UriTemplate="/getDetails?name={name}", ResponseFormat = WebMessageFormat.Json, BodyStyle=WebMessageBodyStyle.Wrapped)]
Admin_UserDetails getUserDetails();
In the above code, the first [Operation Contract] will be returning XML message format. The second one will be returning in JSON format.
Now, my question is that will I have to create another service for the JSON [Operation Contract] or is it ok to write in the same service?