I am posting XmlDocument to ApiController (from windows service, service is working fine, it is posting correct, I used it in wcf web API), but XML is always null, what am I doing wrong?
I can post some class, such in tutorials, or Get any data and everything will be ok, but I can’t post XmlDocument.
public class XmlController : ApiController
{
public void PostXml(XmlDocument xml)
{
// code
}
}
I’ve found a solution:
We need to use inheritance to inherit MediaTypeFormatter
Then register it in Global.asax:
Controller: