Though Wordpress provides TinyMCE and the code editor, which are more than enough for me, I decided to check out the offline/desktop posting utilities available out there. I used to use w.blogger, but a quick check showed that it was not currently being updated (or probably, I was looking at the wrong place). So, I decided to check out the Windows Live Writer, which everyone was writing so much about. Windows Live Writer promises integration with Wordpress.com and custom hosted Wordpress sites too. “Great!”, I thought and downloaded/installed the tool in my WinXP Sp2 box. I don’t know about Wordpress.com integration, which I doubt will have any problems. But, custom Wordpress integration needs certain tweakings from your side.

Error message (Click to enlarge)When I tried setting up the Live Writer with my Wordpress it gave the following error – “Invalid Server Response – The response to the blogger.getUsersBlogs method received from the weblog server was invalid“. A quick Google search brought up this link. I also found another post in Wordpress forums, suggesting disabling all the plugins. After lots of trial and error, I hit upon a solution that solved my problem.

Live Writer makes use of XML RPC protocol to talk with Wordpress. XML RPC makes use of XML for encoding the communication part. So, if the XML parser at Live Writer end is not able to make sense out of the XML response from Wordpress (xmlrpc.php), it complains. This is what happened in my case, as the XML response from my Wordpress site started with TWO newline characters followed by the XML starting tag. I don’t know why, but these characters at the beginning of the XML stream choke most XML parsers out there. I have seen this problem with Firefox 2.0/1.5, Feedburner etc.,. Here is a BKM of what I learnt regarding this.

How to fix the error – “Invalid Server Response – The response to the blogger.getUsersBlogs method received from the weblog server was invalid

  1. First step is to check the security part. Make sure your xmlrpc.php in the Wordpress root directory is given Read and Execute instructions for you. Check with your hosting service people to see if this is properly set. Most probably your host should have given you a control panel for managing your webspace, you should be able to do this from there. For Wordpress.com hosted websites, I guess this should have been already taken care of.
  2. Go to your Wordpress root directory. Open your wp-blog-header.php. Remove the NEWLINE characters (Enter’s) at the start of the file, before <?php tag, and from the end, after the closing ?> tag. Now save this. Make sure you remove the newlines from the following files too.
    • wp-blog-header.php
    • wp-config.php
    • wp-settings.php
  3. Check if step (2) has solved your problem. If not, do step (2) for the theme files of your site, located under $WORDPRESS_ROOT/wp-content/themes/.
    • For example, if I am using Misty Look theme, I’d be checking under $WORDPRESS_ROOT/wp-content/themes/MistyLook
  4. Try connecting now. If still you have problems, don’t worry yet, let us try one more thing. Sometime the plugins do cause extra output. This may be the cause. Try disabling all the plugins in your Wordpress installation and try. If it works, great! Now, enable the plugins one by one and check to find out the culprit.

If you are not able to connect to your WP still or you have found another solution that I missed here, do let me know. BTW, I am using Wordpress 2.1 / PHP 5.2.0