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
This is used by protocols like SOAP who need ISO8601-formatted dates no matter what.
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.
Parameters: |
|
---|
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.)
Serializes ctx.out_object.
If ctx.out_stream is not None, ctx.out_document and ctx.out_string are skipped and the response is written directly to ctx.out_stream.
Parameters: |
|
---|
You must override this function if you want your protocol to support validation.
Set that contains keywords about a protocol.