Changes between Initial Version and Version 1 of JSON-RPC


Ignore:
Timestamp:
Oct 24, 2006, 7:12:22 AM (18 years ago)
Author:
Sung-jin Hong
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • JSON-RPC

    v1 v1  
     1Simply see [XML-RPC]. Use the [http://www.freenet.org.nz/dojo/pyjson/ SimpleJSONRPCServer] instead of SimpleXMLRPCServer and you are done!
     2
     3You'll also want [http://developer.spikesource.com/wiki/index.php/Article:Accessing_JSON-RPC_with_Python JSON RPC Client] too.
     4
     5
     6{{{
     7$ cat testjsonrpc.py
     8import sys
     9import jsonrpclib
     10rpc_srv = jsonrpclib.ServerProxy("http://localhost:8000/json_rpc_srv/")
     11result = rpc_srv.multiply( int(sys.argv[1]), int(sys.argv[2]))
     12print "%d * %d = %d" % (int(sys.argv[1]), int(sys.argv[2]), result['result'])
     13}}}
     14
     15There you go!
     16
     17Another power of python here!
Back to Top