I have a REST WCF service and a WCF client application for it.
My operation has the WebGet attribute with the following properties: BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json
However, when I use the WCF client, the request is made with the body in XML format! This is undesirable! How can I change it to use JSON?
Furthermore, I want to prevent XML from being accepted on the server side, as well – how can I accomplish this? I would have expected specifying RequestFormat to do it but it appears to be just a suggestion?
Edit: nevermind, I am an idiot. I was looking at the wrong operation contract – the right ones were inside a #region that I had not expanded… the client works fine. The server point is still valid but in the context of this question, it’s probably for the better to consider this question closed.
Nevermind, I am an idiot. I was looking at the wrong operation contract – the right ones were inside a #region that I had not expanded… the client works fine. The server point is still valid but in the context of this question, it’s probably for the better to consider this question closed.