I'm creating a WCF Client to an External REST API, but are getting the following error:
OperationFormatter encountered an invalid Message body
The client hits the server correctly and does the 'Post' that I am requiring, but it is expecting a different response Element, basically appending 'Response' to the name of the OperationContract's Name, such as:
OperationFormatter encountered an invalid Message body. Expected to find node type 'Element' with name 'companyResponse' and namespace ''. Found node type 'Element' with name 'company' and namespace ''
Does anybody know how to make it remove the requirement for 'Response' to be added to the name?
Additional Details (I added ReplyAction but it did not make a difference):
[OperationContract(Name="company", Action = "company", ReplyAction = "company")]
[WebInvoke(
Method = "POST",
BodyStyle = WebMessageBodyStyle.WrappedResponse,
ResponseFormat = WebMessageFormat.Xml,
UriTemplate = "companies.xml"
)]
Company AddCompany(Company company);