Bases: object
This is the abstract base class for all protocol implementations. Child classes can implement only the required subset of the public methods.
An output protocol must implement serialize() and create_out_string().
An input protocol must implement create_in_document(), decompose_incoming_envelope() and deserialize().
The ProtocolBase class supports the following events:
The arguments the constructor takes are as follows:
Parameters: |
|
---|
Uses ctx.in_string to set ctx.in_document.
Uses ctx.out_document to set ctx.out_string
Sets the ctx.method_request_string, ctx.in_body_doc, ctx.in_header_doc and ctx.service properties of the ctx object, if applicable.
Takes a MethodContext instance and a string containing ONE document instance in the ctx.in_string attribute.
Returns the corresponding native python object in the ctx.in_object attribute.
Special function to convert native Python exceptions to Http response codes.
Generates MethodContext instances for every callable assigned to the given method handle.
The first element in the returned list is always the primary method context whereas the rest are all auxiliary method contexts.
Method to be overriden to perform any sort of custom method mapping using any data in the method context. Returns a list of contexts. Can return multiple contexts if a method_request_string matches more than one function. (This is called the fanout mode.)
Takes a MethodContext instance and the object to be serialized in the ctx.out_object attribute.
Returns the corresponding document structure in the ctx.out_document attribute.
DEPRECATED! Use generate_method_contexts() instead.
Method to be overriden to perform any sort of custom matching between the method_request_string and the methods.