Package suds :: Package bindings :: Module binding :: Class Binding
[hide private]
[frames] | no frames]

Class Binding

source code

Known Subclasses:

The soap binding class used to process outgoing and imcoming soap messages per the WSDL port binding.

Instance Methods [hide private]
 
__init__(self, wsdl) source code
Element
body(self, content)
Build the <Body/> for an soap outbound message.
source code
[Element,..]
bodycontent(self, method, args, kwargs)
Get the content for the soap body node.
source code
[pdef,]
bodypart_types(self, method, input=True)
Get a list of parameter definitions (pdef) defined for the specified method.
source code
 
detect_fault(self, body)
Detect hidden soapenv:Fault element in the soap body.
source code
Element
envelope(self, header, body)
Build the <Envelope/> for an soap outbound message.
source code
tuple ( Element, Object )
get_fault(self, reply)
Extract the fault from the specified soap reply.
source code
Document
get_message(self, method, args, kwargs)
Get the soap message for the specified method, args and soapheaders.
source code
tuple ( Element, Object )
get_reply(self, method, reply)
Process the reply for the specified method by sax parsing the reply and then unmarshalling into python object(s).
source code
Element
header(self, content)
Build the <Body/> for an soap outbound message.
source code
[Element,..]
headercontent(self, method)
Get the content for the soap Header node.
source code
[pdef,]
headpart_types(self, method, input=True)
Get a list of parameter definitions (pdef) defined for the specified method.
source code
MxLiteral
marshaller(self)
Get the appropriate XML encoder.
source code
Element
mkheader(self, method, hdef, object)
Builds a soapheader for the specified method using the header definition (hdef) and the specified value (object).
source code
Element
mkparam(self, method, pdef, object)
Builds a parameter for the specified method using the parameter definition (pdef) and the specified value (object).
source code
[pdef,..]
param_defs(self, method)
Get parameter definitions.
source code
Object,...
replycomposite(self, rtypes, nodes)
Construct a composite reply.
source code
[Element,...]
replycontent(self, method, body)
Get the reply body content.
source code
 
replyfilter(s, r)
The reply filter function.
source code
[Object,...]
replylist(self, rt, nodes)
Construct a list reply.
source code
[rtype,..]
returned_types(self, method)
Get the xsd.sxbase.SchemaObject returned by the method.
source code
UmxTyped
unmarshaller(self, typed=True)
Get the appropriate XML decoder.
source code
Instance Variables [hide private]
 
options(self)
A dictionary options.
source code
 
schema(self)
The collective schema contained within the wsdl.
source code
suds.wsdl.Definitions wsdl
The wsdl.
Method Details [hide private]

__init__(self, wsdl)
(Constructor)

source code 
Parameters:

body(self, content)

source code 

Build the <Body/> for an soap outbound message.

Parameters:
  • content (Element) - The body content.
Returns: Element
the soap body fragment.

bodycontent(self, method, args, kwargs)

source code 

Get the content for the soap body node.

Parameters:
  • method (service.Method) - A service method.
  • args (list) - method parameter values
  • kwargs (dict) - Named (keyword) args for the method invoked.
Returns: [Element,..]
The xml content for the <body/>

bodypart_types(self, method, input=True)

source code 

Get a list of parameter definitions (pdef) defined for the specified method. Each pdef is a tuple (name, xsd.sxbase.SchemaObject)

Parameters:
  • method (service.Method) - A service method.
  • input (boolean) - Defines input/output message.
Returns: [pdef,]
A list of parameter definitions

detect_fault(self, body)

source code 

Detect hidden soapenv:Fault element in the soap body.

Parameters:
  • body (Element) - The soap envelope body.
Raises:

envelope(self, header, body)

source code 

Build the <Envelope/> for an soap outbound message.

Parameters:
  • header (Element) - The soap message header.
  • body (Element) - The soap message body.
Returns: Element
The soap envelope containing the body and header.

get_fault(self, reply)

source code 

Extract the fault from the specified soap reply. If faults is True, an exception is raised. Otherwise, the unmarshalled fault Object is returned. This method is called when the server raises a web fault.

Parameters:
  • reply (str) - A soap reply message.
Returns: tuple ( Element, Object )
A fault object.

get_message(self, method, args, kwargs)

source code 

Get the soap message for the specified method, args and soapheaders. This is the entry point for creating the outbound soap message.

Parameters:
  • method (service.Method) - The method being invoked.
  • args (list) - A list of args for the method invoked.
  • kwargs (dict) - Named (keyword) args for the method invoked.
Returns: Document
The soap envelope.

get_reply(self, method, reply)

source code 

Process the reply for the specified method by sax parsing the reply and then unmarshalling into python object(s).

Parameters:
  • method (str) - The name of the invoked method.
  • reply (str) - The reply XML received after invoking the specified method.
Returns: tuple ( Element, Object )
The unmarshalled reply. The returned value is an Object for a list depending on whether the service returns a single object or a collection.

header(self, content)

source code 

Build the <Body/> for an soap outbound message.

Parameters:
  • content (Element) - The header content.
Returns: Element
the soap body fragment.

headercontent(self, method)

source code 

Get the content for the soap Header node.

Parameters:
  • method (service.Method) - A service method.
Returns: [Element,..]
The xml content for the <body/>

headpart_types(self, method, input=True)

source code 

Get a list of parameter definitions (pdef) defined for the specified method. Each pdef is a tuple (name, xsd.sxbase.SchemaObject)

Parameters:
  • method (service.Method) - A service method.
  • input (boolean) - Defines input/output message.
Returns: [pdef,]
A list of parameter definitions

marshaller(self)

source code 

Get the appropriate XML encoder.

Returns: MxLiteral
An MxLiteral marshaller.

mkheader(self, method, hdef, object)

source code 

Builds a soapheader for the specified method using the header definition (hdef) and the specified value (object).

Parameters:
  • method (str) - A method name.
  • hdef (tuple: (name, xsd.sxbase.SchemaObject)) - A header definition.
  • object (any) - The header value.
Returns: Element
The parameter fragment.

mkparam(self, method, pdef, object)

source code 

Builds a parameter for the specified method using the parameter definition (pdef) and the specified value (object).

Parameters:
  • method (str) - A method name.
  • pdef (tuple: (name, xsd.sxbase.SchemaObject)) - A parameter definition.
  • object (any) - The parameter value.
Returns: Element
The parameter fragment.

param_defs(self, method)

source code 

Get parameter definitions. Each pdef is a tuple (name, xsd.sxbase.SchemaObject)

Parameters:
  • method (service.Method) - A servic emethod.
Returns: [pdef,..]
A collection of parameter definitions

replycomposite(self, rtypes, nodes)

source code 

Construct a composite reply. This method is called when it has been detected that the reply has multiple root nodes.

Parameters:
Returns: Object,...
The unmarshalled composite object.

replycontent(self, method, body)

source code 

Get the reply body content.

Parameters:
  • method (service.Method) - A service method.
  • body (Element) - The soap body
Returns: [Element,...]
the body content

replylist(self, rt, nodes)

source code 

Construct a list reply. This mehod is called when it has been detected that the reply is a list.

Parameters:
Returns: [Object,...]
A list of unmarshalled objects.

returned_types(self, method)

source code 

Get the xsd.sxbase.SchemaObject returned by the method.

Parameters:
  • method (service.Method) - A service method.
Returns: [rtype,..]
The name of the type return by the method.

unmarshaller(self, typed=True)

source code 

Get the appropriate XML decoder.

Returns: UmxTyped
Either the (basic|typed) unmarshaller.