wstools.WSDLTools
index
/home/groups/p/py/pywebsvcs/src/wstools/WSDLTools.py

# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.

 
Modules
       
weakref

 
Classes
       
wstools.Utility.Collection(UserDict.UserDict)
Types
Element
Binding
ImportElement
Message
MessagePart
MessageRole
MessageRoleBinding
Operation
OperationBinding
Port
PortType
Service
exceptions.Exception
WSDLError
HttpAddressBinding
HttpBinding
HttpOperationBinding
HttpUrlEncodedBinding
HttpUrlReplacementBinding
MimeContentBinding
MimeMultipartRelatedBinding
MimePartBinding
MimeXmlBinding
ParameterInfo
HeaderInfo
SOAPCallInfo
SoapAddressBinding
SoapBinding
SoapBodyBinding
SoapFaultBinding
SoapHeaderBinding
SoapHeaderFaultBinding
SoapOperationBinding
WSDL
WSDLReader

 
class Binding(Element)
     Methods defined here:
__init__(self, name, type, documentation='')
addOperationBinding(self, name, documentation='')
findBinding(self, kind)
findBindings(self, kind)
getPortType(self)
Return the PortType object associated with this binding.
load(self, elements)
load_ex(self, elements)
toDom(self)

Methods inherited from Element:
addExtension(self, item)
getWSDL(self)
Return the WSDL object that contains this information item.

 
class Element
    A class that provides common functions for WSDL element classes.
 
  Methods defined here:
__init__(self, name=None, documentation='')
addExtension(self, item)
getWSDL(self)
Return the WSDL object that contains this information item.

 
class HeaderInfo(ParameterInfo)
    HeaderInfo object captures SOAP header binding information.
 
  Methods defined here:
__init__(self, name, type, namespace, element_type=None)

Data and other attributes defined here:
actor = None
mustUnderstand = 0

Data and other attributes inherited from ParameterInfo:
default = None
element_type = 0
namespace = None

 
class HttpAddressBinding
     Methods defined here:
__init__(self, location)

 
class HttpBinding
     Methods defined here:
__init__(self, verb)

 
class HttpOperationBinding
     Methods defined here:
__init__(self, location)

 
class HttpUrlEncodedBinding
    

 
class HttpUrlReplacementBinding
    

 
class ImportElement(Element)
     Methods defined here:
__init__(self, namespace, location)
toDom(self)

Methods inherited from Element:
addExtension(self, item)
getWSDL(self)
Return the WSDL object that contains this information item.

 
class Message(Element)
     Methods defined here:
__init__(self, name, documentation='')
addPart(self, name, type=None, element=None)
load(self, elements)
toDom(self)

Methods inherited from Element:
addExtension(self, item)
getWSDL(self)
Return the WSDL object that contains this information item.

 
class MessagePart(Element)
     Methods defined here:
__init__(self, name)
getElementDeclaration(self)
getTypeDefinition(self)
toDom(self, node)
node -- node representing message

Methods inherited from Element:
addExtension(self, item)
getWSDL(self)
Return the WSDL object that contains this information item.

 
class MessageRole(Element)
     Methods defined here:
__init__(self, type, message, name='', documentation='', action=None)
getMessage(self)
Return the WSDL object that represents the attribute message 
(namespaceURI, name) tuple
getWSDL(self)
Return the WSDL object that contains this information item.
toDom(self, node)

Methods inherited from Element:
addExtension(self, item)

 
class MessageRoleBinding(Element)
     Methods defined here:
__init__(self, type, name='', documentation='')
findBinding(self, kind)
findBindings(self, kind)
load_ex(self, elements)
toDom(self, node)

Methods inherited from Element:
addExtension(self, item)
getWSDL(self)
Return the WSDL object that contains this information item.

 
class MimeContentBinding
     Methods defined here:
__init__(self, part=None, type=None)

 
class MimeMultipartRelatedBinding
     Methods defined here:
__init__(self)
load_ex(self, elements)

 
class MimePartBinding
     Methods defined here:
__init__(self)
load_ex(self, elements)

 
class MimeXmlBinding
     Methods defined here:
__init__(self, part=None)

 
class Operation(Element)
     Methods defined here:
__init__(self, name, documentation='', parameterOrder=None)
addFault(self, message, name, documentation='', action=None)
getFaultAction(self, name)
wsa:Action attribute
getFaultMessage(self, name)
getInputAction(self)
wsa:Action attribute
getInputMessage(self)
getOutputAction(self)
wsa:Action attribute
getOutputMessage(self)
getPortType(self)
getWSDL(self)
Return the WSDL object that contains this Operation.
setInput(self, message, name='', documentation='', action=None)
setOutput(self, message, name='', documentation='', action=None)
toDom(self, node)

Methods inherited from Element:
addExtension(self, item)

 
class OperationBinding(Element)
     Methods defined here:
__init__(self, name, documentation='')
addFaultBinding(self, name, binding)
addInputBinding(self, binding)
addOutputBinding(self, binding)
findBinding(self, kind)
findBindings(self, kind)
getBinding(self)
Return the parent Binding object of the operation binding.
getOperation(self)
Return the abstract Operation associated with this binding.
load_ex(self, elements)
toDom(self, node)

Methods inherited from Element:
addExtension(self, item)
getWSDL(self)
Return the WSDL object that contains this information item.

 
class ParameterInfo
    ParameterInfo object captures parameter binding information.
 
  Methods defined here:
__init__(self, name, type, namespace=None, element_type=0)

Data and other attributes defined here:
default = None
element_type = 0
namespace = None

 
class Port(Element)
     Methods defined here:
__init__(self, name, binding, documentation='')
getAddressBinding(self)
A convenience method to obtain the extension element used
as the address binding for the port.
getBinding(self)
Return the Binding object that is referenced by this port.
getPortType(self)
Return the PortType object that is referenced by this port.
getService(self)
Return the Service object associated with this port.
load_ex(self, elements)
toDom(self, node)

Methods inherited from Element:
addExtension(self, item)
getWSDL(self)
Return the WSDL object that contains this information item.

 
class PortType(Element)
    PortType has a anyAttribute, thus must provide for an extensible
mechanism for supporting such attributes.  ResourceProperties is
specified in WS-ResourceProperties.   wsa:Action is specified in
WS-Address.
 
Instance Data:
    name -- name attribute
    resourceProperties -- optional. wsr:ResourceProperties attribute,
       value is a QName this is Parsed into a (namespaceURI, name)
       that represents a Global Element Declaration.
    operations
 
  Methods defined here:
__init__(self, name, documentation='')
addOperation(self, name, documentation='', parameterOrder=None)
getResourceProperties(self)
getTargetNamespace(self)
load(self, element)
toDom(self)

Methods inherited from Element:
addExtension(self, item)
getWSDL(self)
Return the WSDL object that contains this information item.

 
class SOAPCallInfo
    SOAPCallInfo captures the important binding information about a 
SOAP operation, in a structure that is easier to work with than
raw WSDL structures.
 
  Methods defined here:
__init__(self, methodName)
addInHeaderInfo(self, name, type, namespace, element_type=0, mustUnderstand=0)
Add an input SOAP header description to the call info.
addInParameter(self, name, type, namespace=None, element_type=0)
Add an input parameter description to the call info.
addOutHeaderInfo(self, name, type, namespace, element_type=0, mustUnderstand=0)
Add an output SOAP header description to the call info.
addOutParameter(self, name, type, namespace=None, element_type=0)
Add an output parameter description to the call info.
getInHeaders(self)
Return a sequence of the in headers of the method.
getInParameters(self)
Return a sequence of the in parameters of the method.
getOutHeaders(self)
Return a sequence of the out headers of the method.
getOutParameters(self)
Return a sequence of the out parameters of the method.
getReturnParameter(self)
Return param info about the return value of the method.
setReturnParameter(self, name, type, namespace=None, element_type=0)
Set the return parameter description for the call info.

Data and other attributes defined here:
documentation = ''
encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/'
location = None
namespace = None
soapAction = None
style = 'rpc'
transport = None
use = 'encoded'

 
class Service(Element)
     Methods defined here:
__init__(self, name, documentation='')
addPort(self, name, binding, documentation='')
getWSDL(self)
load(self, elements)
load_ex(self, elements)
toDom(self)

Methods inherited from Element:
addExtension(self, item)

 
class SoapAddressBinding
     Methods defined here:
__init__(self, location)
getWSDL(self)
toDom(self, node)

 
class SoapBinding
     Methods defined here:
__init__(self, transport, style='rpc')
getWSDL(self)
toDom(self, node)

 
class SoapBodyBinding
     Methods defined here:
__init__(self, use, namespace=None, encodingStyle=None, parts=None)
getWSDL(self)
toDom(self, node)

 
class SoapFaultBinding
     Methods defined here:
__init__(self, name, use, namespace=None, encodingStyle=None)
getWSDL(self)
toDom(self, node)

 
class SoapHeaderBinding
     Methods defined here:
__init__(self, message, part, use, namespace=None, encodingStyle=None)

Data and other attributes defined here:
tagname = 'header'

 
class SoapHeaderFaultBinding(SoapHeaderBinding)
     Data and other attributes defined here:
tagname = 'headerfault'

Methods inherited from SoapHeaderBinding:
__init__(self, message, part, use, namespace=None, encodingStyle=None)

 
class SoapOperationBinding
     Methods defined here:
__init__(self, soapAction=None, style=None)
getWSDL(self)
toDom(self, node)

 
class Types(wstools.Utility.Collection)
    
Method resolution order:
Types
wstools.Utility.Collection
UserDict.UserDict

Methods defined here:
__init__(self, parent)
addExtension(self, item)
addSchema(self, schema)
default lambda self, k

Methods inherited from wstools.Utility.Collection:
__getitem__(self, key)
__setitem__(self, key, item)
items(self)
keys(self)
values(self)

Methods inherited from UserDict.UserDict:
__cmp__(self, dict)
__contains__(self, key)
__delitem__(self, key)
__len__(self)
__repr__(self)
clear(self)
copy(self)
get(self, key, failobj=None)
has_key(self, key)
iteritems(self)
iterkeys(self)
itervalues(self)
pop(self, key, *args)
popitem(self)
setdefault(self, key, failobj=None)
update(self, dict)

Class methods inherited from UserDict.UserDict:
fromkeys(cls, iterable, value=None) from __builtin__.classobj

 
class WSDL
    WSDL object models a WSDL service description. WSDL objects
may be created manually or loaded from an xml representation
using a WSDLReader instance.
 
  Methods defined here:
__del__(self)
__init__(self, targetNamespace=None, strict=1)
addBinding(self, name, type, documentation='', targetNamespace=None)
addImport(self, namespace, location)
addMessage(self, name, documentation='', targetNamespace=None)
addPortType(self, name, documentation='', targetNamespace=None)
addService(self, name, documentation='', targetNamespace=None)
load(self, document)
toDom(self)
Generate a DOM representation of the WSDL instance.
Not dealing with generating XML Schema, thus the targetNamespace
of all XML Schema elements or types used by WSDL message parts 
needs to be specified via import information items.

Data and other attributes defined here:
version = '1.1'

 
class WSDLError(exceptions.Exception)
     Methods inherited from exceptions.Exception:
__getitem__(...)
__init__(...)
__str__(...)

 
class WSDLReader
    WSDLReader creates WSDL instances from urls and xml data.
 
  Methods defined here:
loadFromFile(self, filename)
Return a WSDL instance loaded from the given file.
loadFromStream(self, stream, name=None)
Return a WSDL instance loaded from a stream object.
loadFromString(self, data)
Return a WSDL instance loaded from an xml string.
loadFromURL(self, url)
Return a WSDL instance loaded from the given url.

 
Functions
       
DeclareNSPrefix(writer, prefix, nsuri)
FindExtension(object, kind, t_type=<type 'tuple'>)
FindExtensions(object, kind, t_type=<type 'tuple'>)
GetDocumentation(element)
GetExtensions(element)
GetWSAActionFault(operation, name)
Find wsa:Action attribute, and return value or WSA.FAULT
for the default.
GetWSAActionInput(operation)
Find wsa:Action attribute, and return value or the default.
GetWSAActionOutput(operation)
Find wsa:Action attribute, and return value or the default.
ParseQName(value, element)
ParseTypeRef(value, element)
StringIO(...)
StringIO([s]) -- Return a StringIO-like stream for reading or writing
callInfoFromWSDL(port, name)
Return a SOAPCallInfo given a WSDL port and operation name.

 
Data
        DOM = <wstools.Utility.DOM instance>
WSA_LIST = (<class wstools.Namespaces.WSA200408>, <class wstools.Namespaces.WSA200403>, <class wstools.Namespaces.WSA200303>)
ident = '$Id: WSDLTools.py 1122 2006-02-04 01:24:50Z boverhof $'