I am trying to invoke a WCF method from my java client (using jersey) but I am getting the below error in the service log whenever I try to invoke the service.
OperationFormatter encountered an invalid Message body. Expected to find an attribute with name ‘type’ and value ‘object’. Found value ‘string’.
I am not sure if I am passing the values to the service in correct format..
The service accepts 2 parameters (object object1, boolean commit), I am passing the value in json format as below,
Service :
[OperationContract]
[FaultContract(typeof(SLFault))]
[WebInvoke]
public string InsertObject(object object1, bool commit)
json input:
{commit=[true], object1=[{"infoObjectParams":{"DynamicFields":{"idx_Indicator":["Yes"]},"Name":"Test",additionalProperties":{}}}]}
But I am always getting the above error, can someone please helpe me fix my issue?
Thanks,
BB
I was passing wrong format to the WCF service.
Once I modified the input format as below, everything worked…
{“commit”:true,”object1″:{“DynamicFields”:{“idx_Indicator”:[“Yes”]},”additionalProperties”:{}}}
Thanks,
BB