SETUIX Solutions

Technological Divide

XMLRPC Invalid Server Response

Author: setuix Day: Sunday, September 27th, 2009 Time: 8:43 pm Category: Troubleshooting

Sometimes when publishing a blog entry through Windows Live Writer you may experience an error message that says

“The response to the metaWeblog.newPost method received from the blog server was invalid: Invalid response document returned from XmlRpc server”

Sometimes the blog post is published even though you get that error. Most of the time the blog post isn’t published. There are a few things you could do when you get the error. Some steps might work for some bloggers, and some might not work. So try out the solutions below and see which works for you.

Before trying any of the solutions below please do not forget to back up your files in case you make a mistake and need to restore your original files.

1. Save the blog post as a local draft, closing WLW then open it and try publishing again.

2. For older versions of WordPress, include the line below in your xmlrpc.php file:

if ( !isset( $HTTP_RAW_POST_DATA ) ) {
    $HTTP_RAW_POST_DATA = file_get_contents( ‘php://input’ );
}

For newer versions of WordPress that line is already included by default. This is caused by a bug in PHP < 5.2.2 makes $HTTP_RAW_POST_DATA not set by default.

3. Another solution by Alpash Nakers is to add the following lines in your .htaccess file:

<Files xmlrpc.php>
SecFilterInheritance Off
</Files>

4. There might be some conflicting plugins. Try disabling some plugins and enabling them again.

5. This a solution I used when I experienced this problem on my blogs. I’m not sure if this only affects Unix/Linux type servers as this is something to do with capital and lowercase letters. The solution is to try and change the caps for class-IXR.php file that is found in your wp-includes. Either change it to class-ixr.php or class-IXR.php. This solution is further explained at seo-scientist.com.

If you are still experiencing this error and none of the solutions work for you, you can paste your WLW log here and we will try and help you out. To get your WLW log file go to Help, About and click on the Show Log File link.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • StumbleUpon
  • Twitter

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

11 Responses to “XMLRPC Invalid Server Response”

  1. Mike says:

    I tried all these things and still have the problem. Here is the relevant part of my log:

    WindowsLive.Writer.CoreServices.XmlRpcClientInvalidResponseException: Invalid response document returned from XmlRpc server —> System.Xml.XmlException: Root element is missing.
    at System.Xml.XmlTextReaderImpl.Throw(Exception e)
    at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res)
    at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
    at System.Xml.XmlTextReaderImpl.Read()
    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)

    “,”"
    WindowsLiveWriter,8276,Fail,00011,20-Oct-2009 13:32:18.531,”WindowsLive.Writer.Extensibility.BlogClient.BlogClientInvalidServerResponseException: Invalid Server Response – The response to the metaWeblog.newPost method received from the blog server was invalid:

    Invalid response document returned from XmlRpc server
    at WindowsLive.Writer.BlogClient.Clients.XmlRpcBlogClient.CallMethod(String methodName, XmlRpcValue[] parameters)
    at WindowsLive.Writer.BlogClient.Clients.MetaweblogClient.MetaweblogNewPost(String blogId, BlogPost post, Boolean publish)
    at WindowsLive.Writer.BlogClient.Clients.MetaweblogClient.NewPost(String blogId, BlogPost post, INewCategoryContext newCategoryContext, Boolean publish)
    at WindowsLive.Writer.BlogClient.Clients.XmlRpcBlogClient.NewPost(String blogId, BlogPost post, INewCategoryContext newCategoryContext, Boolean publish, String& etag, XmlDocument& remotePost)
    at WindowsLive.Writer.BlogClient.Blog.NewPost(BlogPost post, INewCategoryContext newCategoryContext, Boolean publish)
    at WindowsLive.Writer.PostEditor.UpdateWeblogAsyncOperation.DoWork()
    at WindowsLive.Writer.CoreServices.AsyncOperation.InternalStart()”,” 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.PostEditor.BlogPostEditingManager.UpdateWeblog(Boolean publish)
    at WindowsLive.Writer.PostEditor.BlogPostEditingManager.PostToWeblog(Boolean publish)
    at WindowsLive.Writer.PostEditor.BlogPostEditingManager.Publish()
    at WindowsLive.Writer.PostEditor.PostEditorMainControl.commandPostAndPublish_Execute(Object sender, EventArgs e)
    at WindowsLive.Writer.ApplicationFramework.Command.RaiseEvent(Object eventKey, EventArgs e)
    at WindowsLive.Writer.ApplicationFramework.Command.OnExecute(EventArgs e)
    at WindowsLive.Writer.ApplicationFramework.CommandBarButtonLightweightControl.OnMouseUp
    (MouseEventArgs e)
    at WindowsLive.Writer.Controls.LightweightControl.RaiseMouseUp(MouseEventArgs e)
    at WindowsLive.Writer.Controls.LightweightControlContainerControl.OnMouseUp(MouseEventArgs e)
    at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
    at System.Windows.Forms.Control.WndProc(Message& m)
    at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
    at System.Windows.Forms.ContainerControl.WndProc(Message& m)
    at System.Windows.Forms.UserControl.WndProc(Message& m)
    at WindowsLive.Writer.Controls.LightweightControlContainerControl.WndProc(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
    at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.
    UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
    at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
    at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
    at System.Windows.Forms.Application.Run(Form mainForm)
    at WindowsLive.Writer.ApplicationFramework.SatelliteApplicationForm.Launcher.ThreadMain(Object[] parameters)
    at WindowsLive.Writer.CoreServices.Threading.ThreadStartWithParams.Run()
    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,8276,None,00012,20-Oct-2009 13:32:18.609,”DisplayableException occurred: WindowsLive.Writer.Extensibility.BlogClient.BlogClientInvalidServerResponseException: Invalid Server Response – The response to the metaWeblog.newPost method received from the blog server was invalid:

    Invalid response document returned from XmlRpc server
    at WindowsLive.Writer.BlogClient.Clients.XmlRpcBlogClient.CallMethod(String methodName, XmlRpcValue[] parameters)
    at WindowsLive.Writer.BlogClient.Clients.MetaweblogClient.MetaweblogNewPost(String blogId, BlogPost post, Boolean publish)
    at WindowsLive.Writer.BlogClient.Clients.MetaweblogClient.NewPost(String blogId, BlogPost post, INewCategoryContext newCategoryContext, Boolean publish)
    at WindowsLive.Writer.BlogClient.Clients.XmlRpcBlogClient.NewPost(String blogId, BlogPost post, INewCategoryContext newCategoryContext, Boolean publish, String& etag, XmlDocument& remotePost)
    at WindowsLive.Writer.BlogClient.Blog.NewPost(BlogPost post, INewCategoryContext newCategoryContext, Boolean publish)
    at WindowsLive.Writer.PostEditor.UpdateWeblogAsyncOperation.DoWork()
    at WindowsLive.Writer.CoreServices.AsyncOperation.InternalStart()”,”"
    WindowsLiveWriter,10624,None,00001,20-Oct-2009 13:37:44.358,”User is opted out of CEIP”,”"
    WindowsLiveWriter,10624,None,00002,20-Oct-2009 13:37:44.373,”Starting Windows Live Writer 14.0.8064.206″,”"
    WindowsLiveWriter,10624,None,00003,20-Oct-2009 13:37:44.373,”.NET version: 2.0.50727.3603″,”"
    WindowsLiveWriter,10624,None,00004,20-Oct-2009 13:37:44.404,”No legacy directory to monitor for plugins. Ignoring legacy directory.”,”"
    WindowsLiveWriter,10624,None,00005,20-Oct-2009 13:37:44.420,”Not monitoring legacy registry key in HKLM.”,”"
    WindowsLiveWriter,10624,None,00006,20-Oct-2009 13:37:44.826,”499 499″,”"

    Any ideas?

  2. Fawked says:

    What version of WordPress are you using? If you are using an older version you might want to upgrade to WordPress 2.8.5.

  3. Mike says:

    I am currently using 2.8.4. I will check and see if 2.8.5 fixes the problem. Thanks!

  4. Mike says:

    OK, so I upgraded to 2.8.5 and I am still getting the same error from the server. It is definitely not Livewriter because I used the blog tool I have on my iPhone and it gave a server error. The posts get published, but the error is still thrown. Any other ideas?

  5. Fawked says:

    I need a little bit more information from you:

    1. Your webhost.
    2. PHP Version (If you can easily find that out if you have the Security Scanner WP Plugin). You can get that plugin from here if you dont have it already:
    http://wordpress.org/extend/plugins/wp-security-scan/
    3. List of plugins.
    4. WLW version.

    Some solutions that you can try:

    1. Delete spaces after “?>” from each of the files below:
    xmlrcp.php
    wp-config.php
    wp-blog-header.php
    wp-settings.php

    2. Disable all plugins and enable them one by one and see if maybe one of them might be the culprit.

  6. Mike says:

    1. My webhost is IXWebhosting.com
    2. PHP Version is 4.4.9
    3. Plugins: Add any, Akismet, CR post to ping.fm, Hello Dolly, Must Read Posts, Retaggr, Social Web Links, Thesis Open Hook, WordPress Backup, WP-DBManager, WP Security Scan
    4. WLW version is 14.8064.206 en

    Thanks for your help. I am going to try the other 2 steps you mention, but I believe I did the deletion of the spaces already.

  7. Fawked says:

    I think you have done it all. Only thing I can think of right now is your PHP version. 4.4.9 is pretty old. Try asking your webhost and see if they will upgrade it.

    Also, did you get this problem since the beginning or did it just suddenly pop up?

    Try using the default unedited theme that came with WordPress without any plugins just to be sure.

    But I still feel a PHP upgrade would almost certainly solve your problem.

    • Mike says:

      There are two authors on the site. The one had this problem first and I did not. Then, suddenly, I got the same problem. Hmm…I will see if they will upgrade the PHP on the server. Thanks!

  8. Fawked says:

    Do tell if you get the problem fixed. Good luck!

  9. Sylvain says:

    @Mike: The root element of the response seems to be missing; as I can read from the beginning of your log file:

    “WindowsLive.Writer.CoreServices.XmlRpcClientInvalidResponseException: Invalid response document returned from XmlRpc server —> System.Xml.XmlException: Root element is missing.”

    This make me believe that one of the components on your site is throwing a PHP Warning or Fatal error message. You should take a look with Fiddler (or any other HTML traffic capturing tool) in order to resolve this issue because you will get access to the full response returned by the server and not just the little part written in the log file by Windows Live Writer (WLW).

    On my blog, I’ve recently posted the part 1 of an article on how to use Fiddler to resolve some of the problems between WLW with XML-RPC:

    http://coding-paparazzi.sylvainlafontaine.com/2010/02/solving-connection-problems-wlw.html

    The warning and fatal error messages from PHP are not yet covered (this will be the subject of the part 2); however, the instruction on how to use Fiddler with WLW and XML-RCP could be useful to you for solving this problem.

    For other people having one of the other problems between WLW and XML-RPC, the subjects covered in this part 1 of the article – beside on how to use Fiddler – are the presence of a BOM at the beginning of one of the PHP file (most often this will be the file wp-config.php because this file is often edited post the first step of a new installation of WordPress but it could be another one like xmlrpc.php if you have played with these files) and the presence of extraneous characters at either the beginning (before the opening tag) of the PHP file.



Leave a Reply

Advertisements Advertise.with.us

NEW BUZZES