Package ndg :: Package soap :: Package server :: Package wsgi :: Module zsi :: Class ZSIMiddleware
[hide private]

Class ZSIMiddleware

source code


Middleware configurable to a given ZSI SOAP binding

Instance Methods [hide private]
 
__init__(self, app) source code
 
_getCharset(self) source code
 
_setCharset(self, value) source code
 
_getPath(self) source code
 
_setPath(self, value) source code
 
_getPublishedURI(self) source code
 
_setPublishedURI(self, value) source code
 
_getReaderClass(self) source code
 
_setReaderClass(self, value) source code
 
_getWriterClass(self) source code
 
_setWriterClass(self, value) source code
 
_getWriteResponseSet(self) source code
 
_setWriteResponseSet(self, value) source code
 
_getFilterID(self) source code
 
_setFilterID(self, value) source code
 
initialise(self, global_conf, prefix='', **app_conf)
Set-up ZSI middleware interface attributes.
source code
 
__call__(self, environ, start_response) source code
 
_initCall(self, environ, start_response)
Sub-divided out from __call__ to enable derived classes to easily include this functionality:
source code
 
exception2SOAPFault(self, environ, exception)
Convert an exception into a SOAP fault message
source code
 
parseRequest(self, environ)
Parse SOAP message from environ['wsgi.input']
source code
 
writeResponse(self, environ, start_response, errorCode=None)
This method serializes the SOAP output and sets the response header.
source code
 
addFilter2Environ(self, environ)
Add a key to the current application in the environment so that other middleware can reference it.
source code
Class Methods [hide private]
 
getSOAPWriter(cls, environ)
Access SoapWriter object set in environment by this classes' call method
source code
 
setSOAPWriter(cls, environ, sw)
Set SoapWriter object in environment
source code
Class Variables [hide private]
basestring SOAP_WRITER_KEYNAME = 'ZSI.writer.SoapWriter'
environ key for ZSI SoapWriter instance
basestring PARSED_SOAP_KEYNAME = 'ZSI.parse.ParsedSoap'
environ key for ZSI ParsedSoap instance
basestring CHARSET_OPTNAME = 'charset'
option name to for character set for output
basestring DEFAULT_CHARSET = '; charset=utf-8'
default character setting is utf-8
basestring PATH_OPTNAME = 'path'
option to set path for this endpoint (not including domain name)
basestring WRITE_RESPONSE_OPTNAME = 'writeResponse'
option name for flag to middleware to serialise and output the SoapWriter instance
basestring REFERENCED_FILTERS_OPTNAME = 'referencedFilters'
name for option to enable dereferencing of other middleware via these environ keys
basestring FILTER_ID_OPTNAME = 'filterID'
option name for environ key to enable other middleware to reference this Filter
basestring PUBLISHED_URI_OPTNAME = 'publishedURI'
option name to define path for this endpoint including domain name
basestring READER_CLASS_OPTNAME = 'readerclass'
option name for SOAP reader class
basestring WRITERCLASS_OPTNAME = 'writerclass'
option name for SOAP writer class
  charset = property(_getCharset, _setCharset, doc= "character s...
  path = property(_getPath, _setPath, doc= "Path for endpoint")
  publishedURI = property(_getPublishedURI, _setPublishedURI, do...
  readerClass = property(_getReaderClass, _setReaderClass, doc= ...
  writeResponseSet = property(_getWriteResponseSet, _setWriteRes...
  writerClass = property(_getWriterClass, _setWriterClass, doc= ...
  filterID = property(_getFilterID, _setFilterID, doc= "enable t...
  pathMatch = lambda self, environ:
Method Details [hide private]

initialise(self, global_conf, prefix='', **app_conf)

source code 

Set-up ZSI middleware interface attributes. Overloaded base class method to enable custom settings from app_conf

Parameters:
  • global_conf (dict) - PasteDeploy global configuration dictionary
  • prefix (basestring) - prefix for configuration items
  • app_conf (dict) - PasteDeploy application specific configuration dictionary

_initCall(self, environ, start_response)

source code 

Sub-divided out from __call__ to enable derived classes to easily include this functionality:

  • Set a reference to this WSGI filter in environ if filterID was

set in the config and

  • check the request to see if this filter should handle it

parseRequest(self, environ)

source code 

Parse SOAP message from environ['wsgi.input']

Reading from environ['wsgi.input'] may be a destructive process so the content is saved in a ZSI.parse.ParsedSoap object for use by SOAP handlers which follow in the chain

environ['ZSI.parse.ParsedSoap'] may be set to a ParsedSoap object parsed by a SOAP handler ahead of the current one in the chain. In this case, don't re-parse. If NOT parsed, parse and set 'ZSI.parse.ParsedSoap' environ key

writeResponse(self, environ, start_response, errorCode=None)

source code 

This method serializes the SOAP output and sets the response header. It's the final step and should be called in the last SOAP handler in a chain of handlers or else specify it in the ini file as the last SOAP handler

addFilter2Environ(self, environ)

source code 

Add a key to the current application in the environment so that other middleware can reference it. This is dependent on filterID set in app_conf


Class Variable Details [hide private]

charset

Value:
property(_getCharset, _setCharset, doc= "character set for response")

publishedURI

Value:
property(_getPublishedURI, _setPublishedURI, doc= "fully qualified pat\
h for endpoint")

readerClass

Value:
property(_getReaderClass, _setReaderClass, doc= "ZSI Reader class")

writeResponseSet

Value:
property(_getWriteResponseSet, _setWriteResponseSet, doc= "boolean set\
 to True to write out a " "response from this middleware")

writerClass

Value:
property(_getWriterClass, _setWriterClass, doc= "ZSI Writer Class")

filterID

Value:
property(_getFilterID, _setFilterID, doc= "enable the instance of this\
 middleware to be " "referenced in environ by this identifier")