A qooxdoo JSON-RPC Server in Python.
The RpcPython project provides JSON-RPC backend functionality for web applications using the qooxdoo library ( http://qooxdoo.org ) or simply requiring a JSON-RPC compatible datasource.
1. Python (2.4,2.5, 2.6 should work): The python you use for the qooxdoo toolchain.
2. JSON serializer package. At least one supported package must be installed. Supported packages:
No installation is necessary, the qxjsonrpc library is shipped with this contrib for easier maintenance and upgrade. A local package is also used so there is no conflict with a site-wide installed qxjsonrpc package.
- Start the server by "python start-server.py". The server listenes on port 8000. You can configure the port in the start-server.py script.
- The server imports service classes and calls the service methods. It receives a service name in dot-separated path format and expect to find the class containing the service in a file. If the service name is "foo.bar.baz", the class is named "Baz" in the "foo.bar.baz" module, located in "foo/bar/baz.py" somewhere on the python class path.
- The class file is dynamically loaded and the service object instantiated when the request is received (will be done only once for each service object).
- The classes and methods are protected. The service class is only executed if it is a subclass of qxjsonrpc.server.JsonRpcService and if the called method contains the "public" decorator.
Example: qooxdoo client calls
- service: "qooxdoo.test"
- method: "echo"
- params: ["Hello World']
from qxjsonrpc import public, fail from qxjsonrpc.server import JsonRpcService class Test( JsonRpcService ): @public def echo(self, v): return 'Client said: [ %s ]'%(v,)
Use the RpcConsole contrib project as a frontend to test the service classes of your python backend.
- Viktor Ferenczi <python (at) cx.hu> (Original author of qxjsonrpc)
- Christian Boulanger <info (at) bibliograph.org> (Server wrapper, RpcPython contrib update)