[Zope] I'm clumsy with XML-RPC.
Kyler Laird
Kyler at Lairds.com
Thu Dec 25 09:10:40 EST 2003
It's been a long time since I poked at Zope with XML-RPC. I was hoping
to start using it for a very public set of tools, but the only things I
can do right now are very clumsy.
I have a Python Script, "test", in Zope with parameters "first=None,
second=None". The Script just "prints" and returns the values.
Trying what would seem to be an elegant way of calling it,
Zope_server.test(first='foo', second='bar')
yields an error.
TypeError: __call__() got an unexpected keyword argument 'second'
O.k., so I fall back to an old script I wrote that uses Meerkat (which
still works!) and see that I can pass it a dictionary. Try again.
Zope_server.test({'first': 'foo', 'second': 'bar'})
"first={'second': 'bar', 'first': 'foo'}\nsecond=None\n"
That still doesn't give me access to "second".
I've been looking in the obvious places for examples with multiple
parameters but I've found none. Any pointers? (I think I originally
worked from an article by Jon Udell at Byte but it seems to have
disappeared.)
The obvious alternative is to ditch XML-RPC and just use plain HTTP.
Zope knows how to handle HTTP well enough and I'm quite comfortable with
it, so it's almost my preference. I just thought that XML-RPC seemed
like a cleaner way to handle this (and I'd recommended it for some other
uses so I thought I should get some real experience with it).
Thank you.
--kyler
More information about the Zope
mailing list