Please consider donating: https://www.corelan.be/index.php/donate/


3,358 views

Windows Live Writer unable to connect to WordPress Blog

Keywords : Invalid response document returned from XmlRpc server – System.Xml.XmlException: Unexpected end of file while parsing Name has occurred –

After moving my old Sharepoint based blog to WordPress, I have encountered some problems when trying to connect Windows Live Writer to WordPress. When trying to connect Live Writer to my blog, I received “Invalid response document returned from XmlRpc server”

The Windows Live Writer log file (Help – About Windows Live Writer – “Show log file”) indicated this :

Invalid response document returned from XmlRpc server
   at WindowsLive.Writer.BlogClient.BlogClientBase.CreateAuthenticatedCredential()
   at WindowsLive.Writer.BlogClient.BlogClientBase.Login()
   at WindowsLive.Writer.BlogClient.Clients.BloggerCompatibleClient.GetUsersBlogs()
   at WindowsLive.Writer.BlogClient.Detection.BlogAccountDetector.ValidateService()","   at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
   at System.Environment.get_StackTrace()
   at WindowsLive.Writer.CoreServices.Diagnostics.LogFileTraceListener.Fail(String message)
   at System.Diagnostics.TraceInternal.Fail(String message)
   at System.Diagnostics.Trace.Fail(String message)
   at WindowsLive.Writer.BlogClient.Detection.BlogAccountDetector.ReportError(Exception ex, MessageId errorMessageType, Object[] errorMessageParams)
   at WindowsLive.Writer.BlogClient.Detection.BlogAccountDetector.ValidateService()
   at WindowsLive.Writer.BlogClient.Detection.BlogServiceDetector.AttemptRsdBasedDetection(IProgressHost progressHost, RsdServiceDescription rsdServiceDescription)
   at WindowsLive.Writer.BlogClient.Detection.BlogServiceDetector.DetectBlogService(IProgressHost progressHost)
   at WindowsLive.Writer.CoreServices.Progress.ProgressWorker.DoWork()
   at WindowsLive.Writer.CoreServices.Progress.MultipartAsyncOperation.DoWork()
   at WindowsLive.Writer.CoreServices.AsyncOperation.InternalStart()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()"
WindowsLiveWriter,1.5428,Fail,00022,14-Oct-2008 22:21:10.930,"WindowsLive.Writer.BlogClient.Detection.BlogServiceDetectorBase+BlogAccountDetectorException: Blog account detector did not succeed
   at WindowsLive.Writer.BlogClient.Detection.BlogServiceDetectorBase.ReportErrorAndFail(MessageId errorMessageType, Object[] errorMessageParams)
   at WindowsLive.Writer.BlogClient.Detection.BlogServiceDetector.AttemptRsdBasedDetection(IProgressHost progressHost, RsdServiceDescription rsdServiceDescription)
   at WindowsLive.Writer.BlogClient.Detection.BlogServiceDetector.DetectBlogService(IProgressHost progressHost)","   at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
   at System.Environment.get_StackTrace()
   at WindowsLive.Writer.CoreServices.Diagnostics.LogFileTraceListener.Fail(String message)
   at System.Diagnostics.TraceInternal.Fail(String message)
   at System.Diagnostics.Trace.Fail(String message)
   at WindowsLive.Writer.BlogClient.Detection.BlogServiceDetector.DetectBlogService(IProgressHost progressHost)
   at WindowsLive.Writer.CoreServices.Progress.ProgressWorker.DoWork()
   at WindowsLive.Writer.CoreServices.Progress.MultipartAsyncOperation.DoWork()
   at WindowsLive.Writer.CoreServices.AsyncOperation.InternalStart()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()"
WindowsLiveWriter,1.5428,None,00023,14-Oct-2008 22:22:10.060,"Exception parsing XML-RPC response:

WindowsLive.Writer.CoreServices.XmlRpcClientInvalidResponseException: Invalid response document returned from XmlRpc server —> System.Xml.XmlException: Unexpected end of file while parsing Name has occurred. Line 18, position 16.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
   at System.Xml.XmlTextReaderImpl.Throw(Int32 pos, String res, String arg)
   at System.Xml.XmlTextReaderImpl.ParseQName(Boolean isQName, Int32 startOffset, Int32& colonPos)
   at System.Xml.XmlTextReaderImpl.ThrowTagMismatch(NodeData startTag)
   at System.Xml.XmlTextReaderImpl.ParseEndElement()
   at System.Xml.XmlTextReaderImpl.ParseElementContent()
   at System.Xml.XmlTextReaderImpl.Read()
   at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)
   at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
   at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
   at System.Xml.XmlDocument.Load(XmlReader reader)
   at System.Xml.XmlDocument.LoadXml(String xml)
   at WindowsLive.Writer.CoreServices.XmlRpcMethodResponse..ctor(String responseText)
   — End of inner exception stack trace —
   at WindowsLive.Writer.CoreServices.XmlRpcMethodResponse..ctor(String responseText)
   at WindowsLive.Writer.CoreServices.XmlRpcClient.CallMethod(String methodName, XmlRpcValue[] parameters)



 
   
     
       
 
  isAdmin1
  url
http://www.corelan.be:8800/
  blogid1
  blogNamePeter Van Eeckhoutte’s Blog
  xmlrpc
http://www.corelan.be:8800/xmlrpc.php


     
   
 
WindowsLiveWriter,1.5428,Fail,00024,14-Oct-2008 22:22:10.061,"WindowsLive.Writer.Extensibility.BlogClient.BlogClientInvalidServerResponseException: Invalid Server Response – The response to the blogger.getUsersBlogs method received from the weblog server was invalid:

 

If you look at the output of the xml (at the bottom of the log file), and/or if you use a web-mitm-proxy (Paros) /sniffer to look at the http communication, you can see that the xml file is in fact truncated. The methodResponse element is not closed, which results in an error within Windows Live Writer

image

This is caused because something (a plugin ? my webserver (IIS) ? something else ?) decided to add UTF-8 BOM to the XML-RPC response. Result : the xml response is 3 bytes longer than expected, which causes the xml response to be truncated.

Solution : find the class.IXR.php file (under wp-includes), edit the file, and look for

function output($xml)

FInd the line that calculates the length 
$length = strlen($xml);

and replace it by

$length = strlen($xml)+3;

Save the file, and try again. Problem should now be solved.

© 2008 – 2021, Peter Van Eeckhoutte (corelanc0d3r). All rights reserved.

2 Responses to Windows Live Writer unable to connect to WordPress Blog

  • Pingback: windows live writer+wordpress????? | ??

  • Pingback: znoe » 用Windows Live Writer(WLW)写Wordpress日志(解决连接出错)

Corelan Training

We have been teaching our win32 exploit dev classes at various security cons and private companies & organizations since 2011

Check out our schedules page here and sign up for one of our classes now!

Donate

Want to support the Corelan Team community ? Click here to go to our donations page.

Want to donate BTC to Corelan Team?



Your donation will help funding server hosting.

Corelan Team Merchandise

You can support Corelan Team by donating or purchasing items from the official Corelan Team merchandising store.

Protected by Copyscape Web Plagiarism Tool

Corelan on Slack

You can chat with us and our friends on our Slack workspace:

  • Go to our facebook page
  • Browse through the posts and find the invite to Slack
  • Use the invite to access our Slack workspace
  • Categories