I have a WCF service that is returning an XElement, this is working fine however I would like it to include the XML Declaration in the response:
<?xml version="1.0" encoding="utf-8"?>
The client side is not something that I can change and is reporting a "Result is not XML" The only other differences between the response of my HTTP result is the content type of my WCF service:
Content-Type: application/xml; charset=utf-8
vs.
Content-Type: text/xml; charset=utf-8
I assume the "Result is not XML" is being caused by the missing XML Declaration. How is it possible to add the XML Declaration to the XElement response? I thought a MessageFormatter might be able fix this, however I have no idea where to start.