Esempio n. 1
0
 def _marshaled_single_dispatch(self, request):
     # TODO - Use the multiprocessing and skip the response if
     # it is a notification
     # Put in support for custom dispatcher here
     # (See SimpleXMLRPCServer._marshaled_dispatch)
     method = request.get('method')
     params = request.get('params')
     try:
         response = self._dispatch(method, params)
     except:
         exc_type, exc_value, exc_tb = sys.exc_info()
         fault = Fault(-32603, '%s:%s' % (exc_type, exc_value))
         return fault.response()
     if 'id' not in request.keys() or request['id'] == None:
         # It's a notification
         return None
     try:
         response = jsonrpclib.dumps(response,
                                     methodresponse=True,
                                     rpcid=request['id']
                                     )
         return response
     except:
         exc_type, exc_value, exc_tb = sys.exc_info()
         fault = Fault(-32603, '%s:%s' % (exc_type, exc_value))
         return fault.response()
 def _marshaled_single_dispatch(self, request):
     # TODO - Use the multiprocessing and skip the response if
     # it is a notification
     # Put in support for custom dispatcher here
     # (See SimpleXMLRPCServer._marshaled_dispatch)
     method = request.get('method')
     params = request.get('params')
     try:
         response = self._dispatch(method, params)
     except:
         exc_type, exc_value, exc_tb = sys.exc_info()
         fault = Fault(-32603, '%s:%s' % (exc_type, exc_value))
         return fault.response()
     if 'id' not in request.keys() or request['id'] == None:
         # It's a notification
         return None
     try:
         response = jsonrpclib.dumps(response,
                                     methodresponse=True,
                                     rpcid=request['id'])
         return response
     except:
         exc_type, exc_value, exc_tb = sys.exc_info()
         fault = Fault(-32603, '%s:%s' % (exc_type, exc_value))
         return fault.response()
Esempio n. 3
0
 def _marshaled_dispatch(self, data, dispatch_method = None):
     response = None
     try:
         request = jsonrpclib.loads(data)
     except Exception, e:
         fault = Fault(-32700, 'Request %s invalid. (%s)' % (data, e))
         response = fault.response()
         return response
 def _marshaled_dispatch(self, data, dispatch_method=None):
     response = None
     try:
         request = jsonrpclib.loads(data)
     except Exception, e:
         fault = Fault(-32700, 'Request %s invalid. (%s)' % (data, e))
         response = fault.response()
         return response