[Zope] xmlrpc calls require string results?
Toby Dickenson
tdickenson@geminidataloggers.com
Fri, 5 Nov 1999 08:13:06 -0000
> I'm using xmlrpclib from a standalone Python script to post
> articles to
> Squishdot. It seems that calls to methods that return
> strings work fine,
> while calls to other methods fail with tracebacks like the following:
>
> Traceback (innermost last):
> File "./postToControlCom.py", line 77, in ?
> postMessage(msg)
> File "./postToControlCom.py", line 68, in postMessage
> summary, subject, "Automation List")
> File "./xmlrpclib.py", line 547, in __call__
> return self.__send(self.__name, args)
> File "./xmlrpclib.py", line 630, in __request
> request
> File "./xmlrpclib.py", line 582, in request
> headers
> xmlrpclib.ProtocolError: <ProtocolError for
> silver.control.com/zope/: 500
> Internal Server Error>
>
.....
> # if a method called by it doesn't return a string.
> # This is bogus, but:
> return 'Done'
>
> BTW: all of this appears to me to be true whether or not Squishdot is
> involved -- I have tested with target methods that are not part of it.
>
> What am I doing wrong here?
Obviously xmlrpclib needs to be able to marshal the return value back to the
caller. The xmlrpc spec has no equivalent of the 'None' that results from a
returnless function in python, hence the error.
The return values does not have to be a string; just something that xmlrpc
understands.