def call(self, method, *args):

        # build data sent to the service
        request_id = random.randint(0, sys.maxint)
        data = {'id': request_id, 'method': method, 'params': args, }
        if self.version:
            data['jsonrpc'] = self.version #mandatory key/value for jsonrpc2 validation else err -32600
        request = json.dumps(data)

        # make HTTP request (retry if connection is lost)
        response = self.__transport.request(
            self.__host,
            self.__handler,
            request,
            verbose=self.__verbose
        )

        # store plain request and response for further debugging
        self.json_request = request
        self.json_response = response

        # parse json data coming from service
        # {'version': '1.1', 'id': id, 'result': result, 'error': None}
        response = json.loads(response)

        self.error = response.get('error', {})
        if self.error and self.exceptions:
            raise JSONRPCError(self.error.get('code', 0),
                               self.error.get('message', ''),
                               self.error.get('data', None))
        if response['id'] != request_id:
            raise JSONRPCError(0, "JSON Request ID != Response ID")

        return response.get('result')
JSON RPC communication (method invocation)
dataset/ETHPy150Open uwdata/termite-data-server/web2py/gluon/contrib/simplejsonrpc.py/ServerProxy.call