Saturday, July 25, 2009 11:39 AM rrobbins

WordPress – there I Fixed That For You

I’ve been having a problem with Windows Live Writer after I installed a WordPress plugin, Now Reading. That plugin allows me to show the books I’m currently reading on the sidebar.

Windows Live Writer-Error

If I have that plugin enabled, I would get the error above, “Invalid Server Response – The response to the blogger.getUsersBlogs method received from the blog server was invalid: Invalid response document returned from XmlRpc server”. Many people have encountered that error and I was able to find several solutions but none of them fixed my problem. Being a rock star programmer, I decided that I would lick this problem and continue to use my plugin with Windows Live Writer. I believe in bending computers to my will instead of living with their problems.

In plain English the error message means the XML response from WordPress does not validate because it is not valid XML. I don’t know why they could not say that in the error message. You can tell it was written by a Microsoft employee!

In order to troubleshoot this problem you need to see the XML response. I did find a XML-RPC debugger at:  http://gggeek.raprap.it/debugger/ but it is not very helpful when the XML is malformed. It can give you some insight into the methods that are available though. In order to figure out exactly what was going on, I wrote a simple VBScript to submit a POST request to the xmlrpc.php file and saved the response to a file. That’s right, I used VBScript! VBScript is perfect for simple tasks that do not warrant a lot of effort.

   1: ' #################################################
   2: ' # VBScript To Call WordPress XMLRPC             #
   3: ' # Need to examine XML response to troubleshoot  #
   4: ' # programmed by Robert S. Robbins on 06/10/2009 #
   5: ' #################################################
   6:  
   7: Set oXMLHTTP = WScript.CreateObject("MSXML2.XMLHTTP")
   8: oXMLHTTP.open "POST", "http://www.williamsportwebdeveloper.com/cgi/wp/xmlrpc.php",False
   9:  
  10: oXMLHTTP.setRequestHeader "Content-Type", "text/xml"
  11: 'oXMLHTTP.send "<?xml version='1.0'?><methodCall><methodName>system.listMethods</methodName><params></params></methodCall>"
  12: oXMLHTTP.send "<?xml version='1.0'?><methodCall><methodName>demo.sayHello</methodName><params></params></methodCall>"
  13:  
  14: 'MsgBox oXMLHTTP.responseText,vbInformation, "XMLRPC Response"
  15:  
  16: Set fso = WScript.CreateObject("Scripting.FileSystemObject")
  17: strWorkingDirectory = Left(WScript.ScriptFullName, InStrRev(WScript.ScriptFullName,"\")-1)
  18: ' unicode format designator -1 solves the "Invalid procedure call or argument" error
  19: Set objOutputFile = fso.CreateTextFile(strWorkingDirectory & "\wp-response.xml", True, -1)
  20: objOutputFile.Write oXMLHTTP.responseText
  21: Set objOutputFile =  Nothing
  22:  
  23: MsgBox  "Done Processing!"

This script calls a XmlRpc method, it does not matter which one, and saves the result to a file. I was able to determine that the XML was invalid because 2 characters where truncated from the end of the last tag.

I’m not exactly sure why two characters get truncated with that plugin enabled but I did find the closing tag in the class-IXR.php file in the wp-includes directory. This file uses a XML template contained within within a nowdoc string, a PHP string that is not parsed. Apparently this is a PHP version of the <![CDATA[ ]]> construct but is meant to exclude quotes from parsing. Anyway, I was able to solve my problem by adding two more line breaks before the closing EOD;. This may not be the only problem with your XML. I also had a problem with a BOM (Byte Order Mark) that Microsoft Expression Web sneakily added to a PHP file I edited (Thanks, Expression Web, that was real sly of you). But I recently upgraded WordPress and I only had to apply my hack to the class-IXR.php file to get Windows Live Writer to accept the XML response from my WordPress blog.

Filed under: , ,

Comments

# re: WordPress – there I Fixed That For You

Thursday, March 25, 2010 3:39 PM by Sara

Hi all. You can't have a light without a dark to stick it in. Help me! I find sites on the topic: Combining proventil and vanceril. I found only this - <a href="genericproventil.info/.../">fibromyalgia and proventil</a>. Proventil, warming many from compound and only fresh first boxes will modify you apply top time. Proventil, this is the nds tired recording. Thanks for the help :-(, Sara from Vietnam.

# re: WordPress – there I Fixed That For You

Monday, July 26, 2010 5:25 PM by latin escorts

I would like to read more on this blog soon. BTW, pretty nice design your blog has, but don’t you think it should be changed from time to time?

Lily Strangfield

# re: WordPress – there I Fixed That For You

Monday, August 02, 2010 6:45 PM by Natasha Stepman

It is certainly interesting for me to read the article. Thanx for it. I like such themes and anything that is connected to them. I would like to read more on this blog soon. By the way, pretty good design that blog has, but don’t you think it should be changed every few months?

Natasha Stepman

<a href="http://www.baccaratgirls.com">high class escort service</a>

# re: WordPress – there I Fixed That For You

Thursday, August 05, 2010 9:16 AM by FrequentlyHere

Cool blog you got here. I'd like to read more about that matter. The only thing it would also be great to see on this blog is some pics of some devices.

John Kripke

<a href="www.jammer-store.com/">cell jammers</a>

# re: WordPress – there I Fixed That For You

Wednesday, September 01, 2010 11:41 AM by lake geneva escorts

Keep on posting such themes. I love to read stories like this. Just add some pics :)

# re: WordPress – there I Fixed That For You

Tuesday, November 30, 2010 6:21 AM by Sara Pingtown

Damn, pretty great post. Where will I get that RSS?

Sara  Pingtown

<a href="nycescort.org/">escorts in new york</a>

# re: WordPress – there I Fixed That For You

Friday, December 03, 2010 3:07 PM by Bella Simpson

It was certainly interesting for me to read that article. Thanks the author for it. I like such themes and everything that is connected to this matter. I would like to read more soon.

Bella Simpson

<a href="irelandescortdirectory.com/">ireland independent escorts</a>

# re: WordPress – there I Fixed That For You

Tuesday, March 08, 2011 2:17 AM by Joan Swenson

Pretty nice place you've got here. Thanx for it. I like such themes and everything connected to this matter. I definitely want to read more soon.

Joan Swenson    

<a href="milanescorts.com/">class escort palermo</a>

# re: WordPress – there I Fixed That For You

Thursday, March 10, 2011 7:20 AM by Cheap Backlinks

Hi, i just needed to come here to inform you about a seriously inexpensive service that posts comments similar to this on millions of Wordpress blogs. Just why you might ask, well you may wish to sell something and target webmasters or simply just increase the quantity of backlinks your web site has that will increase your Google rankins which will then bring your website more visitors and money. Take a quick look at this web site for more info. hellomotow.net/backlinks

Leave a Comment

(required) 
(required) 
(optional)
(required)