Here is the scenario. There is an existing service contract with some methods which are getting consumed by a desktop app. Now need to expose some operation contracts via ReST. But it demands to expose all the methods as ReST. Else there is exception with below text which often comes if the params are wrapped.
Really confusing. Seems like a bug in framework.
Error message -
Operation 'SaveEntitiy' of contract 'IService' specifies multiple request body parameters to be serialized without any wrapper elements. At most one body parameter can be serialized without wrapper elements. Either remove the extra body parameters or set the BodyStyle property on the WebGetAttribute/WebInvokeAttribute to Wrapped.
Operation contract.
[ServiceContract]
public interface IService
{
[OperationContract] //No need to expose this as ReST
string SaveEntity(int id,string name);
[OperationContract]
[WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json)]
string GetData(int value);
}
If we expose the SaveEntity as ReST everthing works. Means the configs are correct.