Skip to content. | Skip to navigation

Sections
Personal tools
What is this?
Hi, my name is Tom Lazar and I'm a Plone and Zope developer based in Berlin, Germany and this is my personal and professional (no big difference, really...) website.
 

Zope, XML-RPC and DateTime

Filed Under:

One word: duh!

And here I was, wondering all along why TextMate's neat Blogging bundle didn't work with Quills' MetaWeblogAPI implementation. When retrieving or posting an entry it would always barf at the entry's dateCreated attribute. Being the author^Wculprit of Quills MetaWeblogAPI I figured, I might be doing something wrong here. And sure enough: turns out I'm returning the date in RFC822 format, whereas the XML-RPC spec requires ISO8601.
So, I changed it, but still no dice. WTF? Using the indispensable XML-RPC Client debugger I noticed, that a Wordpress instance that I used as reference returned the following XML-RPC for dateCreated:
<member>
    <name>dateCreated</name>
    <value>
        <dateTime.iso8601>20060713T19:04:45</dateTime.iso8601>
    </value>
</member>

whereas Quills...

<member>
    <name>dateCreated</name>
    <value>
        <string>2006-08-19T00:33:47+02:00</string>
    </value>
</member>
...returned a String object, not a DateTime object... But returning a DateTime object
        struct = {
'postid': obj.UID(),
'dateCreated': obj.effective(),
[...]

resulted in a exceptions.OverflowError - long int exceeds XML-RPC limits... *sigh* Turns out, Zope's XMLRPC library only learned how to deal with DateTime objects as recently as in version 2.9.3(!) -- whereas tomster.org is being hosted on 2.8.8.

At this point I was in no mood to give up -- I had gone too far already. So I migrated tomster.org to Zope2.9.4 and sure enough! Quills now returned a XML-RPC DateTime object, w00t! Except... it looks like this
<dateTime.iso8601>2006-08-19T00:33:47+02:00</dateTime.iso8601>

instead of

<dateTime.iso8601>20060713T19:04:45</dateTime.iso8601>
and so the blogging client still barfs on it!!
I was just about to dig further, when I noticed that Zope2.9.4 was segfaulting with the Data.fs of tomster.org ca. once every minute... I guess it just wasn't meant to be...
Now I'm back at Zope 2.8.8, a little bit wiser regarding XML-RPC... and still writing blog entries in Kupu... And if you've read this entry all the way to here, you probably should consider getting a life. I know, I am ;-)