Hello,
I'm using cherrypy server to receive requests over a pyAMF channel from a python client. I started with the mock up below and it works fine:
Server:
import cherrypy
from pyamf.remoting.gateway.wsgi import WSGIGateway
def echo(*args, **kwargs):
return (args, kwargs)
class Root(object):
def index(self):
return "running"
index.exposed = True
services = {
'myService.echo': echo,
}
gateway = WSGIGateway(services, debug=True)
cherrypy.tree.graft(gateway, "/gateway/")
cherrypy.quickstart(Root())
Client:
from pyamf.remoting.client import RemotingService
path = 'http://localhost:8080/gateway/'
gw = RemotingService(path)
service = gw.getService('myService')
print service.echo('one=1, two=3')
Result: [[u'one=1, two=3'], {}]
now if instead of:
def echo(*args, **kwargs):
return (args, kwargs)
I use:
def echo(**kwargs):
return kwargs
and send the same request, I get the following error:
TypeError: echo() takes exactly 0 arguments (1 given)
while at the same time:
>>> def f(**kwargs): return kwargs
...
>>> f(one=1, two=3)
{'two': 3, 'one': 1}
>>>
Question: Why is this happening? Please share insights
I'm using: python 2.5.2, cherrypy 3.1.2, pyamf 0.5.1