[Zope] xmlrpclib, TypeError, "Too many arguments"
Tim Hicks
tim@sitefusion.co.uk
Mon, 4 Nov 2002 19:28:39 -0000 (GMT)
ZopeCrew,
I'm using xmlrpc between two zope instances (well, actually, between 1
instance during development).
Things were working well and I was able to call remote methods and get the
return values. However, today, I made a few changes to my code (on both
the client and the server side), and now I'm only getting 'Fault's back
when the methods are called over xmlrpc.
So, I have my Server class and my Client class. Server has method objects
created dynamically, thus:
class Method:
def __init__(self, obj, method):
self.obj = obj
self.method = method
def __call__(self, *args, **kw):
method = getattr(self.getCurrentConverter(), self.method)
return apply(method, args, kw)
class Server(...):
def manage_afterAdd(self, item, container):
for each_string in aList:
setattr(self, each_string, Method(self, each_string))
This setup works when the methods are called directly from zope. The
method that gets fetched within the __call__ has the following call
signature:
def word2html(self, file, b64, cleanup=1, tidy=1, *args, **kw)
and I know that I'm passing the right number of parameters over the wire
via xmlrpc because I've used Shane Hathaway's TCPWatch program to verify
(see below).
However, I keep getting TypeError:"Too many arguments" returned in my
Fault message.
Does anyone have any idea what's going wrong?
tim
[00:00.000 - client 137.222.10.83:3511 forwarded to is-webz.bris.ac.uk:8080]
[00:00.000 - server connected]
POST /RPC2 HTTP/1.0
Host: is-webz.bris.ac.uk:4444
User-Agent: xmlrpclib.py/0.9.8 (by www.pythonware.com)
Content-Type: text/xml
Content-Length: 31414
AUTHORIZATION: Basic dGltOnVwb3J0YWw=
<?xml version='1.0'?>
<methodCall>
<methodName>word2html</methodName>
<params>
<param>
<value><string>0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAABAAAAKAAAAAAAAAAA
[snip a whole load of base64 encoded stuff]
AAAAAAAAAAAAAAAA
</string></value>
</param>
<param>
<value><int>1</int></value>
</param>
<param>
<value><int>1</int></value>
</param>
<param>
<value><int>1</int></value>
</param>
</params>
</methodCall>