Mar 02
2009Windows Live Writer Invalid Server Response
Filed Under: Tips & Tricks, Tutorials/How-Tos, Useful Resources, WordPress
6395 visits, 1 today
I recently upgraded this blog to WordPress 2.7.1 and had trouble accessing old posts via Windows Live Writer. I get the following error message “The response to the metaWeblog.getRecentPosts method received from the blog server was invalid: Invalid response document returned from XmlRpc server”:
After searching the web, I found that many people have been seeing the same error message too. There are numerous reasons why this error appears and even more ways to fix this issue. Most of the explanations I found were too complicated and technical. It took me a long time to figure them out, so to spare you the technical jargon, I’ll only share how I fixed my problem.
- Open all the *.php files in your blog default directory and remove all the trailing spaces after the closing tag ?> at the end. Likely culprit files are wp-blog-header.php, wp-config.php, and xmlprc.php. However, I found that several other *.php files also have trailing spaces after the ?>.
- Deactivate all the WordPress plugins on your blog and reactivate them one at a time. Each plugin you activate, click Open in Windows Live Writer to see if you can access any of the old posts. For me, the plugin that caused problem was Dagon Design Sitemap Generator. Other people had problems with Google Sitemap and Smart Archive plugins.
Related Articles: |



Hrmm.. this reminds me of when the internet was broken by Internet Explorer and everyone had to conform to some weird HTML standard that Microsoft decided to impose. Using Microsoft stuff with non-Microsoft stuff is always troublesome in my opinion.
Does this Live Writer thing have something of benefit than just using the WordPress admin interface?
I don’t think the whitespace and new line in php files is a problem with newer versions of Windows live Writer. I am pretty sure we changed it to remove whitespace at the beginning and end of the xml response from the server before trying to parse it.
The problem with some plug-ins is that they often times print out warnings or error messages in the XML that is returned by the user.
For example, the WordPress server might return:
@warning example_plugin.php line 22: blah blah blah
…
And that warning at the top makes it be invalid xml.
If you email me your Windows Live Writer I might be able to verify that is the exact problem in your case. If it is, contacting the developers of the plugin is the best solution. They should be able to fix the problem quickly. The warning might be related to the upgraded version of WordPress.
-Brandon Turner [MSFT]
@Light487 I’ve used the WordPress admin interface to blog for years, but when I discovered Windows Live Writer, I was completely sold. It’s so much easier to write / edit posts offline. Adding images / videos to posts is also much easier with WLW.
I wrote a few posts on using WLW in the past:
http://www.shanghaitechwriter.com/2008/07/08/using-windows-live-writer-to-blog/
http://www.shanghaitechwriter.com/2008/09/19/five-minutes-usability-test/
http://www.shanghaitechwriter.com/2008/07/31/editing-images-with-windows-live-writer/
Thanks, it worked for me. I deleted the un-used plugins just to give it a try and voila my blog was up and running.
Keep sharing such cool tips.
Santosh
@Brandon: maybe it will be the case with the next version of Windows Live Writer (WLW) but at this moment, march 2, 2010, this is totally not the case with my version of WLW running on WinXP: there is absolutely no stripping of any blank space or of an UTF-8 BOM when any of them is present before the XML response and this result in a truncated – and therefore invalid – XML response as read by WLW.
It’s a shame that in 2010, there are still a lot of potential communication problems between Windows Live Writer (WLW) and a PHP based XML-RPC blog server.
On my blog, I’ve recently posted an article on how to solve many of these problems by first identifying them precisely using either the log file of WLW and/or an HTML traffic capturing tool such as Fiddler. Beside the log file and Fiddler, this article also covers in detail some of the most common problems such a the presence of an UTF-8 BOM at the beginning of one of the PHP script files or the presence of extraneous characters at either the beginning (before the opening tag ) of one of those PHP script files.
You can find this article there:
http://coding-paparazzi.sylvainlafontaine.com/2010/02/solving-connection-problems-wlw.html
In the second part (soon to be published), I will cover the problem of the presence of Warning and of Fatal PHP error messages in the XML-RPC response file. Fatal errors are usually the result of some kind of error in the PHP code but you can get a Warning error message simply by having a badly set php.ini file; so it’s often simply a local configuration problem of PHP.
.-= Sylvain´s last blog ..Solving the connection problems of Windows Live Writer (WLW), Part 1 =-.