[Zope] python-script to python-script XMLRPC

Dennis Allison allison at sumeru.stanford.EDU
Fri Jan 9 21:13:07 EST 2004


I have a system which uses XMLRPC to execute zope methods remotely for
administrative purposes.  I shamelessly borrowed the xmlrpcBasicAuth code
(thanks Amos and Chris) used by ZSyncer to provide a xmlrpc server proxy
with BasicAuthTransport.

To execute a method remotely, I first create a server

server = Server( url, username='...', password='...')

where url references the object upon which the method is to be applied or 
the object which contains the object to be executed.  

To execute a method with id of foo, on then executes

getattr( server, 'foo')( [params] )

where params is a dictionary containing the name/value pairs needed by the
method.

This works for DTML methods, but fails for Python Scripts with diagnostics
related to mismatched counts of parameters.  

For the moment, I've worked around the problem with a DTML method wrapper 
for my python script, but thats ugly!  What's the right Python Script
interface to be called by XMLRPC?

  





More information about the Zope mailing list