hat the RPC call be canceled.
The RPC system may cancel it immediately, may wait awhile and then cancel it,
or may not even cancel the call at all. If the call is canceled, the “done”
callback will still be called and the RpcController will indicate that the
call failed at that time.

_exception_ ` google.protobuf.service. ` ` RpcException ` ¶

    

Exception raised on failed blocking RPC method call.

` args ` ¶

    

` with_traceback ` (  )  ¶

    

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

_class_ ` google.protobuf.service. ` ` Service ` ¶

    

Abstract base interface for protocol-buffer-based RPC services.

Services themselves are abstract classes (implemented either by servers or as
stubs), but they subclass this base interface. The methods of this interface
can be used to call the methods of the service without knowing its exact type
at compile time (analogous to the Message interface).

` CallMethod ` (  _method_descriptor_ , _rpc_controller_ , _request_ , _done_
)  ¶

    

Calls a method of the service specified by method_descriptor.

If “done” is None then the call is blocking and the response message will be
returned directly. Otherwise the call is asynchronous and “done” will later be
called with the response value.

In the blocking case, RpcException will be raised on error.

Preconditions:

  * method_descriptor.service == GetDescriptor 

  * request is of the exact same classes as returned by GetRequestClass(method). 

  * After the call has started, the request must not be modified. 

  * “rpc_controller” is of the correct type for the RPC implementation being used by this Service. For stubs, the “correct type” depends on the RpcChannel which the stub is using. 

Postconditions:

  * “done” will be called when the method is complete. This may be before CallMethod() returns or it may be at some point in the future. 

  * If the RPC failed, the response value passed to “done” will be None. Further details about the failure can be found by querying the RpcController. 

` GetDescriptor ` (  )  ¶

    

Retrieves this service’s descriptor.

` GetRequestClass ` (  _method_descriptor_ )  ¶

    

Returns the class of the request message for the specified method.

CallMethod() requires that the request is of a particular subclass of Message.
GetRequestClass() gets the default instance of this required type.

Example

method = service.GetDescriptor().FindMethodByName(“Foo”) request =
stub.GetRequestClass(method)() request.ParseFromString(input)
service.CallMethod(method, request, callback)

` GetResponseClass ` (  _method_descriptor_ )  ¶

    

Returns the class of the response message for the specified method.

This method isn’t really needed, as the RpcChannel’s CallMethod constructs the
response protocol message. It’s provided anyway in case it is useful for the
caller to know the response type in advance.

###  [ Table of Contents ](../../index.html)

  * [ google.protobuf ](../protobuf.html)
  * [ google.protobuf.any_pb2 ](any_pb2.html)
  * [ google.protobuf.descriptor ](descriptor.html)
  * [ google.protobuf.descriptor_database ](descriptor_database.html)
  * [ google.protobuf.descriptor_pb2 ](descriptor_pb2.html)
  * [ google.protobuf.descriptor_pool ](descriptor_pool.html)
  * [ google.protobuf.duration_pb2 ](duration_pb2.html)
  * [ google.protobuf.empty_pb2 ](empty_pb2.html)
  * [ google.protobuf.field_mask_pb2 ](field_mask_pb2.html)
  * [ google.protobuf.internal.containers ](internal/containers.html)
  * [ google.protobuf.json_format ](json_format.html)
  * [ google.protobuf.message ](message.html)
  * [ google.protobuf.message_factory ](message_factory.html)
  * [ google.protobuf.proto_builder ](proto_builder.html)
  * [ google.protobuf.reflection ](reflection.html)
  * google.protobuf.service 
  * [ google.protobuf.service_reflection ](service_reflection.html)
  * [ google.protobuf.struct_pb2 ](struct_pb2.html)
  * [ google.protobuf.symbol_database ](symbol_databas