Today I got this error message from WLW: “The response to the metaWeblog.newMediaObject method received from the weblog server was invalid“. Why did WLW think the response was “invalid“?? What exactly did it receive from Wordpress??

Luckily, WLW logs a lot more in the background. You can access that log file via Help -> About WLW. Click on the “Show Log Results” link in the dialog box. This will open the log folder.

Mine had this trace dump:

WindowsLiveWriter,21504,Fail,00020,18-Mar-2008 14:00:01.479,”WindowsLive.Writer.Extensibility.BlogClient.BlogClientInvalidServerResponseException: Invalid Server Response - The response to the metaWeblog.newMediaObject method received from the weblog 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.DoBeforePublishUploadWork(IFileUploadContext uploadContext)
at WindowsLive.Writer.PostEditor.WeblogBlogFileUploader.DoUploadWorkBeforePublish(IFileUploadContext uploadContext)
at WindowsLive.Writer.PostEditor.BlogPostReferenceFixer.FileUploadWorker.DoUploadWork(BlogFileUploader fileUploader)
at WindowsLive.Writer.PostEditor.BlogPostReferenceFixer.LocalFileTransformer.Transform(String reference)
at WindowsLive.Writer.CoreServices.HTML.HtmlReferenceFixer.LocalFileReferenceFixupFilter.FixReferences(String reference)
at WindowsLive.Writer.CoreServices.HTML.HtmlReferenceFixer.OnBeginTag(BeginTag tag)
at WindowsLive.Writer.CoreServices.LightWeightHTMLDocumentIterator.Parse()
at WindowsLive.Writer.CoreServices.HTML.HtmlReferenceFixer.FixLocalFileReferences(String html, ReferenceFixer fixer)
at WindowsLive.Writer.PostEditor.UpdateWeblogAsyncOperation.LocalSupportingFileUploader.UploadFilesBeforePublish()
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.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)

Pretty neat stack trace,eh? ;) It clearly shows that DoUploadWork() (Invoked by UpdateWebLog()) method fails for some reason. Armed with this knowledge, I took a look at my post. I had many pictures in that and my WLW was setup to upload pictures through XML RPC. So, obviously that was causing some kind of trouble. I traced down the big picture (size: ~0.7MB) in my post, resized it to 40K and published again. Voila, things worked perfectly!

I googled for the error message, since I wanted to know how other people solved this. Looks like increasing the memory size for PHP in the server side will also help. So, one of the following things should help you to solve this problem:

  1. If you have images embedded that need to be uploaded to the server, make sure they are not big. I don’t have any idea on the *optimal* size. I guess anything less than 100K should be ok.
  2. If still you are getting the same error, try increasing the memory_limit value in php.ini to 12M or 16M. Check this page for info on memory_limit. If you don’t have access to your server, you may have to talk with your host provider.

I believe the first solution will fix this error, in most of the cases. Do let me know in the comments, if you come across any other solutions.

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>