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>
Tim Hicks writes:
... xmlrpc raises "TypeError, two many arguments" ... ...
[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 Are you sure, you want your request go to "/RPC2"?
Dieter
Dieter Maurer said:
Tim Hicks writes:
... xmlrpc raises "TypeError, two many arguments" ... ...
[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 Are you sure, you want your request go to "/RPC2"?
No, I think that was a mistake on my part when I was writing my initial post. However, I got to the bottom of things eventually. See http://lists.zope.org/pipermail/zope-dev/2002-November/017922.html and resulting thread for more information. cheers, tim
On 6 Nov 2002 at 15:41, Tim Hicks wrote:
However, I got to the bottom of things eventually. See http://lists.zope.org/pipermail/zope-dev/2002-November/017922.html and resulting thread for more information.
gee, sorry this is a bit late reply. I had the same problem exposing PythonScript objects via xml-rpc. Eventually I settled on accepting only two explicite parameters. rqType=None, clientDict={} so, all the kw args from the client actually get stuck into clientDict, and the client passes a request type and the dict. argh.. Brad Clements, bkc@murkworks.com (315)268-1000 http://www.murkworks.com (315)268-9812 Fax AOL-IM: BKClements
participants (3)
-
Brad Clements -
Dieter Maurer -
Tim Hicks