现在的位置: 首页 > 互联网络 > 博客心语 > 正文

WLW:从日志服务器接收的对metaWeblog.getRecentPosts 方法的响应无效

2014-02-01 06:24 博客心语 ⁄ 共 23865字 ⁄ 字号 评论 1 条

    以前好好的使用Windows Live Writer(WLW)写wordpress博客,近来发现在打开原来的博客时出现“服务器响应无效”,详情如下:
    从日志服务器接收的对 metaWeblog.getRecentPosts 方法的响应无效:Invalid response document returned from XmlRpc server

      搜索了网上的许多文章,发现都是问的多,解决的少,而且方法上都是不被别人认可的,在我的机器上也不能通过,看到另一个网友的解决办法,我得到一些启示,结果成功了。

常用的解决办法如下:

Window Live Writer(简称 WLW)是微软发布的一款免费客户端博文写作、发布软件。需要博客程序支持xmlrpc协议及空间服务商开放xmlrpc才可使用。
使用过程中,遇到了几次服务器响应无效的错误提示,前几次都通过修改些文件顺利解决,但这个月遇到同样的错误却搞了一个多星期还是无法解决,升级版本,更 换操作系统,改xmlrpc,加htaccess文件等等,把整站下载回来,架在本地测试,却是正常的。无奈每次发布日志都登录到后 台,wordpress后台发布日志,你懂的~~~不想多说,发布了几次后,发现一个问题,就是日志写完,准备发布之际,会有提示某某关键字有问题,所以 便怀疑是空间商的过滤系统导致了WLW的不正常,便在WLW写同一篇日志,去掉有问题的关键字,OK!正是此原因。

下面把导致WLW不能正常工作的原因作个汇总:

1、wordpress编码原因UTF-8

wp-includes文件夹下, xml-rpc返回的格式不正确,缺三个字节,修正这个问题:
用一个文本编辑工具打开class.ixr.php,查找:
$length = strlen($xml);
替换为:
$length = strlen($xml)+3;

2、插件原因

与某个已经安装启用的 WordPress 插件冲突,停用新启用的插件尝试能否解决;

3、PHP版本原因

解决办法:打开 xmlrpc.php 文件(在wordpress的主目录下),添加如下代码到文件的顶部,<?php 之后:
$HTTP_RAW_POST_DATA = file_get_contents(“php://input”);

4、.htaccess 规则错误

解决办法:将如下代码复制到 .htaccess 文件: (如若无此文件,请联系空间商是否禁止了xmlrpc.php的访问或自行建立此文件试试)
<Files xmlrpc.php>
SecFilterInheritance Off
</Files>

5、wordpress上传路径错误

这种情况一般出现在为wordpress更换了主机后出现,请登录wordpress后台,选项,杂项,填写正确的wordpress上传路径。默认情况下,WordPress 的上传目录是 wordpress/wp-content/uploads/

6、空间服务商启用服务导致

启用过滤系统或权限设置,请联系空间商!
wordpress除了以上几种原因会导致使用WLW服务器响应无效外,在WP后台,你可能还有机会遇到以下这种错误:
An Unexpected HTTP Error occurred during the API request
如果是这种情况,请在wp-includes目录下,找到http.php文件,大概210行的位置:

function request( $url, $args = array() ) {
global $wp_version;
$defaults = array(
‘method’ => ‘GET’,
‘timeout’ => apply_filters( ‘http_request_timeout’, 5),
‘redirection’ => apply_filters( ‘http_request_redirection_count’, 5),
‘httpversion’ => apply_filters( ‘http_request_version’, ’1.0′),
‘user-agent’ => apply_filters( ‘http_headers_useragent’, ‘WordPress/’ . $wp_version ),
‘blocking’ => true,
‘headers’ => array(), ‘body’ => null
);

将其中的:

‘timeout’ => apply_filters( ‘http_request_timeout’, 5),

更改为:

‘timeout’ => apply_filters( ‘http_request_timeout’, 30),

请注意:在wordpress 3.0版本后,相应的http.php文件已更改为:class-http.php

另外的解决方案:

以下是windows live writer的日志。在打开WLW时帮助关于可以看到“显示日志文件”


WindowsLiveWriter,8128,None,00001,23-Feb-2011 11:43:36.062,”User is opted out of CEIP”,”"
WindowsLiveWriter,8128,None,00002,23-Feb-2011 11:43:36.078,”Starting Windows Live Writer 14.0.8117.416″,”"
WindowsLiveWriter,8128,None,00003,23-Feb-2011 11:43:36.078,”.NET version: 2.0.50727.3053″,”"
WindowsLiveWriter,8128,None,00004,23-Feb-2011 11:43:36.140,”No legacy directory to monitor for plugins. Ignoring legacy directory.”,”"
WindowsLiveWriter,8128,None,00005,23-Feb-2011 11:43:36.140,”Not monitoring legacy registry key in HKLM.”,”"
WindowsLiveWriter,8128,None,00006,23-Feb-2011 11:43:36.484,”499 499″,”"
WindowsLiveWriter,8128,Fail,00007,23-Feb-2011 11:43:56.484,”Exception attempting to read RSD file: System.Xml.XmlException: Unexpected XML declaration. The XML declaration must be the first node in the document, and no white space characters are allowed to appear before it. Line 6, position 3.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
at System.Xml.XmlTextReaderImpl.ParsePI(BufferBuilder piInDtdStringBuilder)
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlTextReader.Read()
at WindowsLive.Writer.BlogClient.Detection.RsdServiceDetector.ReadFromRsdStream(Stream rsdStream, String url)”,”   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.RsdServiceDetector.ReadFromRsdStream(Stream rsdStream, String url)
at WindowsLive.Writer.BlogClient.Detection.RsdServiceDetector.DetectFromRsdUrl(String rsdFileUrl)
at WindowsLive.Writer.BlogClient.Detection.RsdServiceDetector.DetectFromWeblog(IHTMLDocument2 weblogDOM)
at WindowsLive.Writer.BlogClient.Detection.BlogServiceDetector.GetRsdServiceDescription(IProgressHost progressHost, IHTMLDocument2 weblogDOM)
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,8128,None,00008,23-Feb-2011 11:44:09.125,”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 12.
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)

<?xml version=”"1.0″”?>
<methodResponse>
  <params>
<param>
<value>
<array><data>
<value><struct>
<member><name>isAdmin</name><value><boolean>0</boolean></value></member>
<member><name>url</name><value><string>http://keleblog.com/</string></value></member>
<member><name>blogid</name><value><string>1</string></value></member>
<member><name>blogName</name><value><string>可乐博</string></value></member>
<member><name>xmlrpc</name><value><string>http://keleblog.com/xmlrpc.php</string></value></member>
</struct></value>
</data></array>
</value>
</param>
</params>
</methodRes”,”"
WindowsLiveWriter,8128,Fail,00009,23-Feb-2011 11:44:09.171,”WindowsLive.Writer.Extensibility.BlogClient.BlogClientInvalidServerResponseException: 服务器响应无效 – 从日志服务器接收的对 blogger.getUsersBlogs 方法的响应无效:

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.PostEditor.Configuration.Wizard.WeblogConfigurationWizardPanelSelectProvider.ValidatePanel()
at WindowsLive.Writer.PostEditor.Configuration.Wizard.WeblogConfigurationWizardController.OnValidatePanel(Object panelControl)
at WindowsLive.Writer.Controls.Wizard.WizardStep.Verify()
at WindowsLive.Writer.Controls.Wizard.WizardController.next()
at WindowsLive.Writer.Controls.Wizard.WizardForm.buttonNext_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.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.SendMessage(HandleRef hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.Control.SendMessage(Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.Control.ReflectMessageInternal(IntPtr hWnd, Message& m)
at System.Windows.Forms.Control.WmCommand(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.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.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
at System.Windows.Forms.Control.DefWndProc(Message& m)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.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.RunDialog(Form form)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at WindowsLive.Writer.PostEditor.Configuration.Wizard.WeblogConfigurationWizardController.ShowDialog(IWin32Window owner, String title)
at WindowsLive.Writer.PostEditor.Configuration.Wizard.WeblogConfigurationWizardController.EditWeblogTemporarySettings(IWin32Window owner)
at WindowsLive.Writer.PostEditor.Configuration.Wizard.WeblogConfigurationWizardController.EditTemporarySettings(IWin32Window owner, TemporaryBlogSettings settings)
at WindowsLive.Writer.PostEditor.Configuration.Settings.AccountPanel.buttonEditConfiguration_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.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.SendMessage(HandleRef hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.Control.SendMessage(Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.Control.ReflectMessageInternal(IntPtr hWnd, Message& m)
at System.Windows.Forms.Control.WmCommand(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.GroupBox.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.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
at System.Windows.Forms.Control.DefWndProc(Message& m)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.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.RunDialog(Form form)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at WindowsLive.Writer.PostEditor.Configuration.Settings.WeblogSettingsManager.EditSettings(IWin32Window owner, TemporaryBlogSettings blogSettings, Boolean showAccountSettings)
at WindowsLive.Writer.PostEditor.Configuration.Settings.WeblogSettingsManager.EditSettings(IWin32Window owner, String id, Boolean showAccountSettings)
at WindowsLive.Writer.PostEditor.Configuration.Accounts.WeblogAccountManagementControl.EditSelectedWeblog()
at WindowsLive.Writer.PostEditor.Configuration.Accounts.WeblogAccountManagementControl.buttonEdit_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.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.SendMessage(HandleRef hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.Control.SendMessage(Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.Control.ReflectMessageInternal(IntPtr hWnd, Message& m)
at System.Windows.Forms.Control.WmCommand(Message& m)
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 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.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
at System.Windows.Forms.Control.DefWndProc(Message& m)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.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.RunDialog(Form form)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at WindowsLive.Writer.PostEditor.PreferencesHandler.ShowPreferences(IWin32Window owner, IBlogPostEditingSite editingSite, Type selectedPanelType)
at WindowsLive.Writer.PostEditor.PostEditorPreferencesEditor.EditAccounts()
at WindowsLive.Writer.PostEditor.PostEditorPreferencesEditor._commandAccounts_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.CommandOwnerDrawMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.MenuItem.MenuItemData.Execute()
at System.Windows.Forms.Command.Invoke()
at System.Windows.Forms.Command.DispatchID(Int32 id)
at System.Windows.Forms.Control.WmCommand(Message& m)
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.Form.WndProc(Message& m)
at WindowsLive.Writer.ApplicationFramework.ApplicationForm.WndProc(Message& m)
at WindowsLive.Writer.ApplicationFramework.SatelliteApplicationForm.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,8128,None,00010,23-Feb-2011 11:48:11.187,”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 15.
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)

<?xml version=”"1.0″”?>
<methodResponse>
  <params>
<param>
<value>
<array><data>
<value><struct>
<member><name>isAdmin</name><value><boolean>0</boolean></value></member>
<member><name>url</name><value><string>http://keleblog.com/</string></value></member>
<member><name>blogid</name><value><string>1</string></value></member>
<member><name>blogName</name><value><string>可乐博</string></value></member>
<member><name>xmlrpc</name><value><string>http://keleblog.com/xmlrpc.php</string></value></member>
</struct></value>
</data></array>
</value>
</param>
</params>
</methodRespon”,”"
WindowsLiveWriter,8128,None,00011,23-Feb-2011 11:49:15.062,”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 9.
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)

<?xml version=”"1.0″”?>
<methodResponse>
<params>
<param>
<value>
<array><data>
<value><struct>
<member><name>isAdmin</name><value><boolean>0</boolean></value></member>
<member><name>url</name><value><string>http://keleblog.com/</string></value></member>
<member><name>blogid</name><value><string>1</string></value></member>
<member><name>blogName</name><value><string>可乐博</string></value></member>
<member><name>xmlrpc</name><value><string>http://keleblog.com/xmlrpc.php</string></value></member>
</struct></value>
</data></array>
</value>
</param>
</params>
</method”,”"
WindowsLiveWriter,6816,None,00001,23-Feb-2011 11:53:44.796,”User is opted out of CEIP”,”"
WindowsLiveWriter,6816,None,00002,23-Feb-2011 11:53:44.812,”Starting Windows Live Writer 14.0.8117.416″,”"
WindowsLiveWriter,6816,None,00003,23-Feb-2011 11:53:44.812,”.NET version: 2.0.50727.3053″,”"
WindowsLiveWriter,6816,None,00004,23-Feb-2011 11:53:44.875,”No legacy directory to monitor for plugins. Ignoring legacy directory.”,”"
WindowsLiveWriter,6816,None,00005,23-Feb-2011 11:53:44.875,”Not monitoring legacy registry key in HKLM.”,”"
WindowsLiveWriter,6816,None,00006,23-Feb-2011 11:53:45.234,”499 499″,”"

看上面的日志可以看到红色部分是从博客读到的XML信息,但最后的红色处并没有读取完全,所以对比上面的<methodResponse>看看少了几个字符。我上面改过两次第一次是改的网上说的+3,但并不正确,后来加为+6还是不对。后来看到老外的原文,我数了下少9个,我下面就修改了10

然后打开你的博客目录下的wp-includes/class-IXR.php文件(网上到处转的class.IXR.php文件是在老版本的wordpress中才是。)

$length = strlen($xml);

改为
$length = strlen($xml)+10;

function output($xml) {
$xml = ‘<?xml version=”1.0″?>’.”\n”.$xml;
$length = strlen($xml)+10;
    header(‘Connection: close’);
header(‘Content-Length: ‘.$length);
header(‘Content-Type: text/xml’);
header(‘Date: ‘.date(‘r’));
echo $xml;
exit;
}

再看看!连接成功了!网上一搜一大片,全是复制别人的。仔细看完泥人的方法,如果你是如此问题这样一定成功了。如果不成功,那就排除此文件问题。可能不是这个原因了。

最后,希望大家有此问题的都能解决。

再介绍另一种处理办法

      我经常编辑一下自己的wordpress程序,但使用的是windows自带的记事本,然后另存为UTF8编码(有时保存为ANSI编码,保存类型为所有文件)的文件,然后上传传到网站上去,预览一下相关的网页正常了即可。殊不知,就是这样的省事造成了内部编码的错误,并最终造成了WLW不能访问该博客(此时因为想从原来的博客上下载一些文章下来编辑一下,结果出现这样的错误)。处理办法,将原来的备份文件中的相应文件替换掉网站上的文件即可;也可以将现在的文件打开(可以用记事本之类的),然后将安装程序中的相应文件用“EmEditor”这样的专门的编辑软件打开,对照前一个文件修改成你需要使用的,然后用“EmEditor”保存为UTF8格式,再上传到自己的网站上去,替换掉原来的文件即可。此时,请再试试你的WLW,看正常了吗?我就是这样改过来的哟!!
      上面的修改过程有一个比较棘手的地方在于,你必须知道出现问题后,你都动了那些程序文件(例如我修改了wp-config.php),这个恐怕只能靠自己了(不合适在备份网站的前提下,重新安装一下,在一步步的用EmEditor来修改,并保存为UTF8格式——这是实在没办法的最后一招)。祝你好运!!

      下面提供一些网友的分析,供你参考:
1.升级google-xml-sitemaps到最新版本(有人怀疑与这个插件有关,我用的好好的)
2.逐个禁用插件,直到解决为止
3.编辑如下内容的一个”.htaccess”放入xmlrpc相应目录下(慎用!)
          <Files xmlrpc.php>�
          SecFilterInheritance Off SecFilterInheritance Off�
          </Files>

目前有 1 条留言    访客:1 条, 博主:0 条

  1. 不銹鋼茶壺 2015年02月11日 9:26 下午  @回复  Δ1楼 回复

    多謝~碰到同樣的問題~按照您的建議已經解決~ 再次感謝

给我留言

留言无头像?