Include xml declaration in xmlrpc


I have recently set up a website that uses Orchard 1.5.1, I attempted to use an application called Blogsy to publish content from my iPad however the application was generating an error when using the xmlrpc. After some investigation and an exchange of emails between myself and the team at Blogsy they identified the problem. It turns out that their application is looking for the xml declaration <?xml version="1.0" encoding="utf-8"?> in the response message from service call. After looking at the code for the XmlRpc -> HomeController I noticed that the XElement is converted to a string and output as content. I modified to write to the response stream directly, this way the xml declaration is included in the response.
        var content = _writer.MapMethodResponse(methodResponse);

        this.Response.ContentType = "text/xml";
Is this something that could be fixed? There are only a handful of applications on the iPad for blogging. I think it would be good if Orchard was supported.


sebastienros wrote Aug 23, 2012 at 8:09 PM

We need to ensure that is was never done like this before in the history of the file, otherwise it might mean that is was converted to text for a specific reason. Otherwise we need to find another technique.

RohanWest wrote Aug 24, 2012 at 12:13 AM

I had a look at the history for Orchard.Core.XmlRpc.Controllers.HomeController and it appears that the action has always returns content without the xml declaration. Looking at various implementations of the xmlrpc it appears that they include the xml declaration.


sebastienros wrote Sep 24, 2012 at 10:36 PM

Fixed in changeset 38509f41229b

sfmskywalker wrote Mar 28, 2014 at 1:28 AM

Fixed in changeset dab9b332cdeba91e4abeb4d9d2a1518a1c8f1a88