This example exits, printing:
{"id": null, "error": {"message": "Parse error", "code": -32700}}
When run from command line or as a CGI executable from Apache. It gets this parse error before any data is sent to it at all. Somethings' not right.
The example given in the source code for jsonrpc seems to only work because it uses Python's provided HTTPserver. I need to run under apache.
This example is supposed to run from the command line, even typed into the Python prompt. I don't know what problem it's having or why it exits. It should set up a service and wait.
Code:
#!/usr/bin/env python
from jsonrpc import handleCGI, ServiceMethod
@ServiceMethod
def echo(msg):
return msg
if __name__ == "__main__":
handleCGI()