[Zope] - XML-RPC

skip@calendar.com (Skip Montanaro) skip@calendar.com (Skip Montanaro)
Thu, 21 Jan 1999 18:42:38 -0500 (EST)


    Pavlos> A month ago I was contemplating implementing Userland's XML-RPC
    Pavlos> protocol in python, and yesterday I noticed Fredrik Lundh posted
    Pavlos> a module for it.  It is a very simple RPC protocol different
    Pavlos> from bci (oops ZClient) and it might be useful to integrate it
    Pavlos> into the forthcoming medusa server.  Skip who seems to have
    Pavlos> taken note of it already might provide some useful info.

Yes, I have been trying it out.  I plan to use XML-RPC to replace the ad hoc
encoding scheme I'm currently using.  The main attractions for me are:

    * it is language-independent, offering at least Python, Perl and
      Frontier interfaces (it was developed by Dave Winer at Userland, the
      Frontier folks) - I need access from both Perl and Python.

    * it was extremely easy to get going, especially after Fredrik Lundh
      (who wrote the Python library) sent me an under 40-line server.

    * I get to throw away some homegrown code (don't laugh).

If you'd like to try it out, grab Fredrik's xmlrpclib module from

    http://www.pythonware.com/madscientist/

install it, then execute

    import xmlrpclib
    s = xmlrpclib.Server("http://dolphin.calendar.com:8000")
    print s.latlong("San Francisco", "CA")
    print s.latlong("Stockholm", "", "Sweden")
    try:
        print s.latlong("Spam", "", "Eggs")
    except xmlrpclib.Fault, fault:
        print "oops...", fault.faultString

which should display

    [37.775, -122.418333]
    [59.3833, 18.0]
    oops... No latlong for (Spam, , Eggs)

that is, you get lat/long coordinates back for the first two cities and a
catchable fault response for the third.

I'm not really in a position to compare XML-RPC and ZClient and I can't seem 
to get to www.zope.org at the moment to do any reading on ZClient.

Skip Montanaro	   | Mojam: "Uniting the World of Music" http://www.mojam.com/
skip@calendar.com  | Musi-Cal: http://concerts.calendar.com/
518-372-5583