[dev] Interacting with the horde RPC/SOAP interface

Markus Meyer meyer at mesw.de
Sun Feb 18 08:52:43 PST 2007


Hi everyone,

first thanks for Horde which works very well for me.

I'm asking because I'm trying to communicate with Horde through the RPC
interface. As a first exercise I wanted to write a small script which
downloads all Horde calendars to my local hard disk. This way, I can
look at my calendars in, say, Mozilla Sunbird even if I lose Internet
connectivity.

I'm using the version of Horde which comes with the last version 8.1.0
of the "Plesk" server administration tool. This means I'm using Imp H3
(4.1.3) and Kronolith H3 (2.1.3), if this makes sense.

The idea was to call the "calendar.listCalendars" method which would
return a list of calendars I have access to, then export those calendars
using "calendar.exportCalendar". However, when I call
"calendar.listCalendars", an empty array is returned. I'm using the
SOAPpy module for python on the client and the XML SOAP exchange looks
as follows:

*** Outgoing SOAP ******************************************************
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<ns1:calendar.listCalendars xmlns:ns1="urn:horde" SOAP-ENC:root="1">
<owneronly xsi:type="xsd:boolean">False</owneronly>
<permission xsi:type="xsd:int">2</permission>
</ns1:calendar.listCalendars>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
************************************************************************
*** Incoming SOAP ******************************************************
<?xml version="1.0" encoding="UTF-8"?>

<SOAP-ENV:Envelope 
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
 xmlns:ns4="urn:horde"
 SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>

<ns4:calendar.listCalendarsResponse>
<output xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[1]"
xsi:nil="true"/></ns4:calendar.listCalendarsResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
************************************************************************

I tried to debug this on the server side by listing the content of the
$calendars variable to the system log in function
Kronolith::listCalendars(). Interestingly enough, the variable
$calendars contains all my calendars on return of the function
Kronolith::listCalendars(). Still the information does not seem to make
it through into the XML.

I'm pretty sure I have the right permissions because I can actually
download the calendars (see below).

To check if I can download a calendar, I found out the id of my calendar
and called "calendar.exportCalendar(id, 'text/calendar')". This indeed
returns my whole calendar as a vcalendar file inside some XML. But when
SOAPpy tries to parse this, it says that it isn't well-formed XML. This
is apparently because the XML contains special chars (like umlauts)
which are not in UTF-8 (though the <?xml> comment says so). Apparently
Horde store my umlauts in another encoding but fails to convert those to
UTF-8 when embedding them in the XML.

Thanks for any help/pointers.


Markus




More information about the dev mailing list