I am using WCF to return a plain old XML (POX) document to the caller. I am using the XML Serializer formatter to turn the objects into XML.
In the returned docum
In my RESTful WCF service which I wrote prior to the WCF RESTful starter kit I did the following which gives me nice, clean results.
First, make sure the webHttp endpoint behavior is set:
Your endpoint should look something like this (minus the contract for simplicity):
My service contract has these operation contracts in it:
[WebGet(UriTemplate="tasks", ResponseFormat=WebMessageFormat.Xml )]
[OperationContract]
Task[] GetTasks();
[WebGet(UriTemplate="tasks/{id}", ResponseFormat=WebMessageFormat.Xml)]
[OperationContract]
Task GetTask(string id);
The service implementation itself has nothing special about it. You can try changing up the WebMessageFormat but the only other item in the enumeration is "json".