This class is the abstract base class for all server transport implementations. Unlike the client transports, this class does not define a pure-virtual method that needs to be implemented by all base classes.
If there needs to be a call to start the main loop, it’s called serve_forever() by convention.
Calls create_in_document and decompose_incoming_envelope to get method_request string in order to generate contexts.
Uses the ctx.in_string to set ctx.in_body_doc, which in turn is used to set ctx.in_object.
Calls the matched user function by passing it the ctx.in_object to set ctx.out_object.
Uses the ctx.out_object to set ctx.out_document and later ctx.out_string.
Uses the ctx.out_object to set ctx.out_document and later ctx.out_string.
The transport type, which is a URI string to its definition by convention.
A server that uses http as transport via wsgi. It doesn’t contain any server logic.
A PEP-3333 compliant callable class.
If you want to have a hard-coded URL in the wsdl document, this is how to do it:
wsgi_app = WsgiApplication(...)
wsgi_app.doc.wsdl11.build_interface_document("http://example.com")
This is not strictly necessary – if you don’t do this, Spyne will get the URL from the first request, build the wsdl on-the-fly and cache it as a string in memory for later requests. However, if you want to make sure you only have this url on the WSDL, this is how to do it. Note that if your client takes the information in the Wsdl document seriously (not all do), all requests will go to the designated url above even when you get the Wsdl from another location, which can make testing a bit difficult. Use in moderation.
Called right before the wsdl data is returned to the client.
Called right after an exception is thrown during wsdl generation. The exception object is stored in ctx.transport.wsdl_error attribute.
Called first when the incoming http request is identified as a rpc request.
Called right before the output stream is returned to the WSGI handler.
Called right before returning the exception to the client.
Called after the whole data has been returned to the client. It’s called both from success and error cases.
This function is only called by the HttpRpc protocol to have the wsgi environment parsed into ctx.in_body_doc and ctx.in_header_doc.
Calls create_in_document and decompose_incoming_envelope to get method_request string in order to generate contexts.
This function runs on first request because it needs the ‘SERVER_NAME’ from the wsgi request environment.
Uses the ctx.in_string to set ctx.in_body_doc, which in turn is used to set ctx.in_object.
Calls the matched user function by passing it the ctx.in_object to set ctx.out_object.
Uses the ctx.out_object to set ctx.out_document and later ctx.out_string.
Uses the ctx.out_object to set ctx.out_document and later ctx.out_string.
Serialize errors to an iterable of strings and return them.
Parameters: |
|
---|
Sets ctx.method_request_string if there’s a match. It’s O(n) which means you should keep your number of patterns as low as possible.
Parameters: |
|
---|
Implement your event loop here, if needed.
The WSGI-Specific method context. WSGI-Specific information is stored in the transport attribute using the WsgiTransportContext class.
alias of HttpTransportContext
The public name of the method the method_request_string was matched to.
Holds the WSGI-specific information
The class that is used in the transport attribute of the WsgiMethodContext class.
WSGI Request environment
HTTP Request verb, as a convenience to users.
The spyne.server.zeromq module contains a server implementation that uses ZeroMQ (zmq.REP) as transport.
The ZeroMQ server transport.
Calls create_in_document and decompose_incoming_envelope to get method_request string in order to generate contexts.
Uses the ctx.in_string to set ctx.in_body_doc, which in turn is used to set ctx.in_object.
Calls the matched user function by passing it the ctx.in_object to set ctx.out_object.
Uses the ctx.out_object to set ctx.out_document and later ctx.out_string.
Uses the ctx.out_object to set ctx.out_document and later ctx.out_string.
Create a ZeroMQ server transport with several background workers, allowing asynchronous calls.
More details on the pattern http://zguide.zeromq.org/page:all#Shared-Queue-DEALER-and-ROUTER-sockets
The public name of the method the method_request_string was matched to.
The spyne.server.null module contains the NullServer class and its helper objects.
The name comes from the “null modem connection”. Look it up.
A server that doesn’t support any transport at all – it’s implemented to test services without having to run a server.
It implicitly uses the ‘sync’ auxiliary processing mode.
**kwargs overwrite *args.
You can do:
logging.getLogger('spyne.server.null').setLevel(logging.CRITICAL)
to hide context delimiters in logs.
Calls create_in_document and decompose_incoming_envelope to get method_request string in order to generate contexts.
Uses the ctx.in_string to set ctx.in_body_doc, which in turn is used to set ctx.in_object.
Calls the matched user function by passing it the ctx.in_object to set ctx.out_object.
Uses the ctx.out_object to set ctx.out_document and later ctx.out_string.
Uses the ctx.out_object to set ctx.out_document and later ctx.out_string.
Implement your event loop here, if needed.