[dev] Interacting with the horde RPC/SOAP interface

Chuck Hagenbuch chuck at horde.org
Mon Feb 26 09:41:39 PST 2007


Quoting Markus Meyer <meyer at mesw.de>:

> 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:

> *** 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've just tried this myself, and I ran into a lot of problems with  
using SOAP. However, I can muck things around in order to force a  
guest user, and I get an empty array (exactly like above), which is  
correct because my system doesn't have any guest calendars.

I also tried using xml-rpc and had much better luck. I assume that  
you're sending HTTP authentication headers with the SOAP request? If  
you can do the same with xml-rpc I think you'll get a proper calendar  
list.

> 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.

Again, xml-rpc may well be more forgiving here. It's also likely that  
we can fix this either in the SOAP lib or in Kronolith/Horde itself;  
if you add a bug report to http://bugs.horde.org/ it won't get lost  
and we can track it down at some point.

Good luck,
-chuck

-- 
"we are plastered to the windshield of the bus that is time." - Chris


More information about the dev mailing list