Problem with Livewriter

Found a bug? Tell us!!
Post Reply
K23
Regular
Posts: 5
Joined: Wed Apr 16, 2008 12:56 pm

Problem with Livewriter

Post by K23 »

Hi all,
I like Serendipity and want to use it with Windows Live Writer. Unfortunately I always get this error message when I want to publish a new post:
Die vom Weblogserver erhaltene Antwort auf die Methode metaWeblog.newPost ist ungültig: Invalid response document returned from XmlRpc server
Image
The posting is not added to my blog (I saw some postings here which say that it's published nevertheless, but in my case it is not).

It also says during configuration that WLW could not download the template (which is not a problem for me but it might be helpful for bug searching).

In configuration I selected myDomain/serendipity_xmlrpc.php (by the way, when I open this manually it says:

Code: Select all

methodResponse>
−
	<fault>
−
	<value>
−
	<struct>
−
	<member>
<name>faultCode</name>
−
	<value>
<int>103</int>
</value>
</member>
−
	<member>
<name>faultString</name>
−
	<value>
<string>XML error: no element found at line 1</string>
</value>
</member>
</struct>
</value>
</fault>
</methodResponse>
Screenshot here: Image

I then selected "Movable Type API" as proposed here.
Image

XML-RPC Plugin is active.
Image

Code: Select all

<?php # $Id: serendipity_xmlrpc.php 1055 2006-04-06 09:14:11Z garvinhicking $
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved.  See LICENSE file for licensing details

if (!defined('S9Y_FRAMEWORK')) {
    require 'serendipity_config.inc.php';
}

$data = array();
serendipity_plugin_api::hook_event('frontend_xmlrpc', $data);

if (count($data) == 0) {
    die(XMLRPC_NO_LONGER_BUNDLED);
}
Any ideas? :roll:
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Problem with Livewriter

Post by garvinhicking »

Hi!

Inside the plugins' serendipity_event_xmlrpc.php or the .inc file there should be some DEBUG constant that you might want to enable, it can capture input and output data to a file on your server, allowing to inspect what might be wrong.

Sadly I myself do not have any knowledge with LiveWriter, but I think i've read that s9y users use it successfully...:

http://blog.softcat.org/index.php?/cate ... erendipity

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
K23
Regular
Posts: 5
Joined: Wed Apr 16, 2008 12:56 pm

Post by K23 »

Hi Garvin,

yes, I've read these docs, that's why I wanted to use the WLW. I've now seen that the new posting is added to my blog. In my first try I used some screenshots and a file attachments, and this does not seem to work. Additionally I saw this error message in the WLW Log:

Code: Select all

WindowsLiveWriter,5972,None,00005,16-Apr-2008 13:25:33.301,"Exception parsing XML-RPC response:

WindowsLive.Writer.CoreServices.XmlRpcClientInvalidResponseException: Invalid response document returned from XmlRpc server ---> System.Xml.XmlException: There are multiple root elements. Line 2, position 2.
   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)
   at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
   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)

<br />
<b>Warning</b>:  cannot yet handle MBCS in html_entity_decode()! in <b>(my file path to serendipity)/plugins/serendipity_event_x",""
WindowsLiveWriter,5972,Fail,00006,16-Apr-2008 13:25:33.348,"WindowsLive.Writer.Extensibility.BlogClient.BlogClientInvalidServerResponseException: Ungültige Serverantwort - Die vom Weblogserver erhaltene Antwort auf die Methode metaWeblog.newPost ist ungültig:

Invalid response document returned from XmlRpc server
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

It seems as if your PHP version is not able to handle some special characters sent by live writer and thus emits a PHP warning message. You can patch your plugin PHP files and add a "@" before the 2 function calls to html_entity_decode which should suppress this. I've added those supressions to the next version of the plugin, too.

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
K23
Regular
Posts: 5
Joined: Wed Apr 16, 2008 12:56 pm

Post by K23 »

Sorry Garvin,

I'm a bit lost: Which plugin PHP files do you mean? the xmlrpc.php does not seem to have this function
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

The plugins/serendipity_event_xmlrpc/*xmlrpc*.php files :)

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
K23
Regular
Posts: 5
Joined: Wed Apr 16, 2008 12:56 pm

Post by K23 »

I wonder why the directory here is "/plugins/serendipity_event_xmlrpc/serendipity_event_xmlrpc/" so 2 times serendipity_event_xmlrpc. Is this correct?

And the correct entry would then be:
$entry['title'] = $post_array['title'],ENT_COMPAT,'UTF-8';
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

No, this is not correct, you shouldn't have such a subdirectory. But on the other hand, serendipity can work with that fine as well.

Code: Select all

$entry['title']          = $post_array['title'],ENT_COMPAT,'UTF-8';
No, it would read

Code: Select all

$entry['title']          = @html_entity_decode($post_array['title'],ENT_COMPAT,'UTF-8');
HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
K23
Regular
Posts: 5
Joined: Wed Apr 16, 2008 12:56 pm

Post by K23 »

Hi Garvin,

yes, that fixed it, thanks! :)

Unfortunately my other posting still could not be uploaded, probably because of the file attachment :cry:
Post Reply