How do I make HttpResponseMessage follow xml schema rather then datacontract?
i tried to do
return new HttpResponseMessage()
{
StatusCode = HttpStatusCode.OK,
Content = new ObjectContent<Foo>(foo, Configuration.Formatters.XmlFormatter)
};
but that did not do the trick.
Also if I do this, Action would always serve xml and would not do content negotiation. I tried to add List as a param, but HttpResponseMessage does not expect a list, just a single item.
Is there a way to allow content negotiation without use of DataContract? Basically now HttpResponseMessage is ignoring xml schema.
I guess the answer to this is to use