[Zope] xml-rpc question

Gilles Lenfant gilles@pilotsystems.net
Tue, 29 Oct 2002 19:00:42 +0100


> hi,
>
> I'm using Zope (2.6.0, Pyth 2.1.3, Solaris 2.7) as an XML-RPC server,
> and need to use the XML-RPC boolean datatype.
>
> I have a test python script, which accepts a single-struct (dictionary)
> parameter, checks a boolean value passed to it and responds with another
>   boolean value, but I'm having problems with importing permissions.
>
> my script, booltest:
>
> ##parameters:=param
> from xmlrpclib import True, False
>
> if param['dead'] == True:
> alive = False
> else:
> alive = True
>
> return {'name': param['name'],
>          'alive': alive}
>

Did you test this without xml-rpc (using the "Test" tab of ZMI ?).
You should start with this.
Seems that importing xmlrpclib is not allowed in a TTW script (only
"string", "math", "random" + some others - see the doc).
Replace the "import..." line by

True = 1
Fales = 0

This should do the job.

HTH

--Gilles