def GetModuleBaseNameFromWSDL(wsdl):
    def add(cls, ns):
    def getModuleName(cls, ns):
    def getAlias(cls, ns):
    def getNSList(cls):
    def __init__(self, val=None):
    def set(self, val):
    def write(self, val):
    def getvalue(self):
    def __iadd__(self, val):
    def __str__(self):
def GetPartsSubNames(args, wsdl):
class NamespaceAliasDict:
class StringWriter:
class MessageContainer: def GetModuleBaseNameFromWSDL(wsdl):
    def add(cls, ns):
    def getModuleName(cls, ns):
    def getAlias(cls, ns):
    def getNSList(cls):
    def __init__(self, val=None):
    def set(self, val):
    def write(self, val):
    def getvalue(self):
    def __iadd__(self, val):
    def __str__(self):
def GetPartsSubNames(args, wsdl):
class NamespaceAliasDict:
class StringWriter:
class MessageContainer: def _get_xsitype(pyclass):
    def __init__(self, pname=None, aname=None, minOccurs=1,
         maxOccurs=1, nillable=False, typed=True, unique=True,
         pyclass=None, attrs_aname='_attrs', **kw):
    def parse(self, elt, ps):
    def serialize(self, elt, sw, pyobj, name=None, orig=None, **kw):
    def text_to_data(self, text, elt, ps):
    def serialize_as_nil(self, elt):
    def SimpleHREF(self, elt, ps, tag):
    def get_parse_and_errorlist(self):
    def checkname(self, elt, ps):
    def checktype(self, elt, ps):
    def name_match(self, elt):
    def nilled(self, elt, ps):
    def simple_value(self, elt, ps, mixed=False):
    def parse_attributes(self, elt, ps):
    def set_attributes(self, el, pyobj):
    def set_attribute_xsi_type(self, el, **kw):
    def set_attribute_href(self, el, objid):
    def set_attribute_id(self, el, objid):
    def get_name(self, name, objid):
    def has_attributes(self):
    def parse(self, elt, ps):
    def get_formatted_content(self, pyobj):
    def serialize_text_node(self, elt, sw, pyobj):
    def serialize(self, elt, sw, pyobj, name=None, orig=None, **kw):
    def __init__(self, pname=None, aslist=False, minOccurs=0, unique=False, **kw):
    def listify(self, v):
    def parse_into_dict_or_list(self, elt, ps):
    def parse(self, elt, ps):
    def get_formatted_content(self, pyobj):
    def serialize(self, elt, sw, pyobj, name=None, **kw):
    def __init__(self, pname=None, strip=True, **kw):
    def text_to_data(self, text, elt, ps):
    def get_formatted_content(self, pyobj):
    def text_to_data(self, text, elt, ps):
    def get_formatted_content(self, pyobj):
    def __init__(self, pname=None, strip=1, **kw):
    def get_formatted_content(self, pyobj):
    def set_prefix(self, elt, pyobj):
    def text_to_data(self, text, elt, ps):
    def serialize_text_node(self, elt, sw, pyobj):
    def text_to_data(self, text, elt, ps):
    def get_formatted_content(self, pyobj):
    def text_to_data(self, text, elt, ps):
    def get_formatted_content(self, pyobj):
    def text_to_data(self, text, elt, ps):
    def get_formatted_content(self, pyobj):
    def __init__(self, pname=None, readerclass=None, **kw):
    def parse(self, elt, ps):
    def get_formatted_content(self, pyobj):
    def __init__(self, choices, pname=None, **kw):
    def parse(self, elt, ps):
    def serialize(self, elt, sw, pyobj, name=None, orig=None, **kw):
    def __init__(self, pname=None, format='%d', **kw):
    def text_to_data(self, text, elt, ps):
    def parse(self, elt, ps):
    def get_formatted_content(self, pyobj):
def _make_inf():
def isnan(x):
    def __init__(self, pname=None, format='%f', **kw):
    def text_to_data(self, text, elt, ps):
    def parse(self, elt, ps):
    def get_formatted_content(self, pyobj):
    def text_to_data(self, text, elt, ps):
    def parse(self, elt, ps):
    def get_formatted_content(self, pyobj):
    def __init__(self, pname=None, comments=0, inline=0, wrapped=True, **kw):
    def parse(self, elt, ps):
    def serialize(self, elt, sw, pyobj, name=None, unsuppressedPrefixes=[], **kw):
    def cb(self, elt, sw, pyobj, unsuppressedPrefixes=[]):
    def __init__(self, pname=None, namespaces=['#all'],
    minOccurs=1, maxOccurs=1, strip=1, **kw):
    def get_formatted_content(self, pyobj):
    def text_to_data(self, text, elt, ps):
    def serialize(self, elt, sw, pyobj, **kw):
    def parse(self, elt, ps):
    def __init__(self, namespaces=['#all'],pname=None,
        minOccurs=1, maxOccurs=1, strip=1, processContents='strict',
        **kw):
    def serialize(self, elt, sw, pyobj, **kw):
    def parse(self, elt, ps):
    def __init__(self, pname=None, minOccurs=1, maxOccurs=1, **kw):
    def setMemberTypeCodes(self):
    def parse(self, elt, ps, **kw):
    def text_to_data(self, text, elt, ps):
    def get_formatted_content(self, pyobj, **kw):
    def __init__(self, pname=None, itemType=None, **kw):
    def text_to_data(self, text, elt, ps):
    def parse(self, elt, ps):
    def serialize(self, elt, sw, pyobj, name=None, orig=None, **kw):
def RegisterType(C, clobber=0, *args, **keywords):
UNBOUNDED = 'unbounded'
TYPES = [o for o in globals().values() if f(o)]
class TypeCode:
class SimpleType(TypeCode):
class Any(TypeCode):
class String(SimpleType):
class URI(String):
class QName(String):
class Token(String):
class Base64String(String):
class Base64Binary(String):
class HexBinaryString(String):
class XMLString(String):
class Enumeration(String):
class Integer(SimpleType):
class Decimal(SimpleType):
class Boolean(SimpleType):
class XML(TypeCode):
class AnyType(TypeCode):
class AnyElement(AnyType):
class Union(SimpleType):
class List(SimpleType): class XMLSchema(XMLSchemaComponent):
    """A schema is a collection of schema components derived from one
       or more schema documents, that is, one or more <schema> element
       information items. It represents the abstract notion of a schema
       rather than a single schema document (or other representation).

       <schema>
       parent:
           ROOT
       attributes:
           id -- ID
           version -- token
           xml:lang -- language
           targetNamespace -- anyURI
           attributeFormDefault -- 'qualified' | 'unqualified', 'unqualified'
           elementFormDefault -- 'qualified' | 'unqualified', 'unqualified'
           blockDefault -- '#all' | list of 
               ('substitution | 'extension' | 'restriction')
           finalDefault -- '#all' | list of 
               ('extension' | 'restriction' | 'list' | 'union')
        
       contents:
           ((include | import | redefine | annotation)*, 
            (attribute, attributeGroup, complexType, element, group, 
             notation, simpleType)*, annotation*)*


        attributes -- schema attributes
        imports -- import statements
        includes -- include statements
        redefines -- 
        types    -- global simpleType, complexType definitions
        elements -- global element declarations
        attr_decl -- global attribute declarations
        attr_groups -- attribute Groups
        model_groups -- model Groups
        notations -- global notations
    """
    attributes = {'id':None, 
        'version':None, 
        'xml:lang':None, 
        'targetNamespace':None,
        'attributeFormDefault':'unqualified',
        'elementFormDefault':'unqualified',
        'blockDefault':None,
        'finalDefault':None}
    contents = {'xsd':('include', 'import', 'redefine', 'annotation',
                       'attribute', 'attributeGroup', 'complexType',
                       'element', 'group', 'notation', 'simpleType',
                       'annotation')}
    empty_namespace = ''
    tag = 'schema'

    def __init__(self, parent=None): 
        """parent -- 
           instance variables:
           targetNamespace -- schema's declared targetNamespace, or empty string.
           _imported_schemas -- namespace keyed dict of schema dependencies, if 
              a schema is provided instance will not resolve import statement.
           _included_schemas -- schemaLocation keyed dict of component schemas, 
              if schema is provided instance will not resolve include statement.
           _base_url -- needed for relative URLs support, only works with URLs
               relative to initial document.
           includes -- collection of include statements
           imports -- collection of import statements
           elements -- collection of global element declarations
           types -- collection of global type definitions
           attr_decl -- collection of global attribute declarations
           attr_groups -- collection of global attribute group definitions
           model_groups -- collection of model group definitions
           notations -- collection of notations

        """
        self.__node = None
        self.targetNamespace = None
        XMLSchemaComponent.__init__(self, parent)
        f = lambda k: k.attributes['name']
        ns = lambda k: k.attributes['namespace']
        sl = lambda k: k.attributes['schemaLocation']
        self.includes = Collection(self, key=sl)
        self.imports = Collection(self, key=ns)
        self.elements = Collection(self, key=f)
        self.types = Collection(self, key=f)
        self.attr_decl = Collection(self, key=f)
        self.attr_groups = Collection(self, key=f)
        self.model_groups = Collection(self, key=f)
        self.notations = Collection(self, key=f)

        self._imported_schemas = {}
        self._included_schemas = {}
        self._base_url = None

    def getNode(self):
        """
        Interacting with the underlying DOM tree.
        """
        return self.__node
    
    def addImportSchema(self, schema):
        """for resolving import statements in Schema instance
           schema -- schema instance
           _imported_schemas 
        """
        if not isinstance(schema, XMLSchema):
            raise TypeError('expecting a Schema instance')
        if schema.targetNamespace != self.targetNamespace:
            self._imported_schemas[schema.targetNamespace] = schema
        else:
            raise SchemaError('import schema bad targetNamespace')

    def addIncludeSchema(self, schemaLocation, schema):
        """for resolving include statements in Schema instance
           schemaLocation -- schema location
           schema -- schema instance
           _included_schemas 
        """
        if not isinstance(schema, XMLSchema):
            raise TypeError('expecting a Schema instance')
        if not schema.targetNamespace or\
             schema.targetNamespace == self.targetNamespace:
            self._included_schemas[schemaLocation] = schema
        else:
            raise SchemaError('include schema bad targetNamespace')
        
    def setImportSchemas(self, schema_dict):
        """set the import schema dictionary, which is used to 
           reference depedent schemas.
        """
        self._imported_schemas = schema_dict

    def getImportSchemas(self):
        """get the import schema dictionary, which is used to 
           reference depedent schemas.
        """
        return self._imported_schemas

    def getSchemaNamespacesToImport(self):
        """returns tuple of namespaces the schema instance has declared
           itself to be depedent upon.
        """
        return tuple(self.includes.keys())

    def setIncludeSchemas(self, schema_dict):
        """set the include schema dictionary, which is keyed with 
           schemaLocation (uri).  
           This is a means of providing 
           schemas to the current schema for content inclusion.
        """
        self._included_schemas = schema_dict

    def getIncludeSchemas(self):
        """get the include schema dictionary, which is keyed with 
           schemaLocation (uri). 
        """
        return self._included_schemas

    def getBaseUrl(self):
        """get base url, used for normalizing all relative uri's 
        """
        return self._base_url

    def setBaseUrl(self, url):
        """set base url, used for normalizing all relative uri's 
        """
        self._base_url = url

    def getElementFormDefault(self):
        """return elementFormDefault attribute
        """
        return self.attributes.get('elementFormDefault')

    def isElementFormDefaultQualified(self):
        return self.attributes.get('elementFormDefault') == 'qualified'

    def getAttributeFormDefault(self):
        """return attributeFormDefault attribute
        """
        return self.attributes.get('attributeFormDefault')

    def getBlockDefault(self):
        """return blockDefault attribute
        """
        return self.attributes.get('blockDefault')

    def getFinalDefault(self):
        """return finalDefault attribute 
        """
        return self.attributes.get('finalDefault')

    def load(self, node, location=None):
        self.__node = node

        pnode = node.getParentNode()
        if pnode:
            pname = SplitQName(pnode.getTagName())[1]
            if pname == 'types':
                attributes = {}
                self.setAttributes(pnode)
                attributes.update(self.attributes)
                self.setAttributes(node)
                for k,v in attributes['xmlns'].iteritems():
                    if k not in self.attributes['xmlns']:
                        self.attributes['xmlns'][k] = v
            else:
                self.setAttributes(node)
        else:
            self.setAttributes(node)

        self.targetNamespace = self.getTargetNamespace()
        for childNode in self.getContents(node):
            component = SplitQName(childNode.getTagName())[1]
                
            if component == 'include':
                tp = self.__class__.Include(self)
                tp.fromDom(childNode)

                sl = tp.attributes['schemaLocation']
                schema = tp.getSchema()

                if sl not in self.getIncludeSchemas():
                    self.addIncludeSchema(sl, schema)

                self.includes[sl] = tp

                pn = childNode.getParentNode().getNode()
                pn.removeChild(childNode.getNode())
                for child in schema.getNode().getNode().childNodes:
                    pn.appendChild(child.cloneNode(1))

                for collection in ['imports','elements','types',
                                   'attr_decl','attr_groups','model_groups',
                                   'notations']:
                    for k,v in getattr(schema,collection).iteritems():
                        if k not in getattr(self,collection):
                            v._parent = weakref.ref(self)
                            getattr(self,collection)[k] = v
                        else:
                            warnings.warn("Not keeping schema component.")
      
            elif component == 'import':
                slocd = SchemaReader.namespaceToSchema
                tp = self.__class__.Import(self)
                tp.fromDom(childNode)
                import_ns = tp.getAttribute('namespace') or\
                    self.__class__.empty_namespace
                schema = slocd.get(import_ns)
                if schema is None:
                    schema = XMLSchema()
                    slocd[import_ns] = schema
                    try:
                        tp.loadSchema(schema)
                    except NoSchemaLocationWarning, ex:
                        # Dependency declaration, hopefully implementation
                        # is aware of this namespace (eg. SOAP,WSDL,?)
                        print "IMPORT: ", import_ns
                        print ex
                        del slocd[import_ns]
                        continue
                    except SchemaError, ex:
                        #warnings.warn(\
                        #    '<import namespace="%s" schemaLocation=?>, %s'\
                        #    %(import_ns, 'failed to load schema instance')
                        #)
                        print ex
                        del slocd[import_ns]
                        class _LazyEvalImport(str):
                            '''Lazy evaluation of import, replace entry in self.imports.'''
                            #attributes = dict(namespace=import_ns)
                            def getSchema(self, namespace):
                                schema = slocd.get(namespace)
                                if schema is None:
                                    parent = self._parent()
                                    wstypes = parent
                                    if isinstance(parent, WSDLToolsAdapter):
                                        wstypes = parent.getImportSchemas()
                                    schema = wstypes.get(namespace)
                                if isinstance(schema, XMLSchema):
                                    self.imports[namespace] = schema
                                    return schema

                                return None

                        self.imports[import_ns] = _LazyEvalImport(import_ns)
                        continue
                else:           
                    tp._schema = schema
            
                if import_ns in self.getImportSchemas():
                    warnings.warn(\
                        'Detected multiple imports of the namespace "%s" '\
                        %import_ns)
            
                self.addImportSchema(schema)
                # spec says can have multiple imports of same namespace
                # but purpose of import is just dependency declaration.
                self.imports[import_ns] = tp
                
            elif component == 'redefine':
                warnings.warn('redefine is ignored')
            elif component == 'annotation':
                warnings.warn('annotation is ignored')
            elif component == 'attribute':
                tp = AttributeDeclaration(self)
                tp.fromDom(childNode)
                self.attr_decl[tp.getAttribute('name')] = tp
            elif component == 'attributeGroup':
                tp = AttributeGroupDefinition(self)
                tp.fromDom(childNode)
                self.attr_groups[tp.getAttribute('name')] = tp
            elif component == 'element':
                tp = ElementDeclaration(self)
                tp.fromDom(childNode)
                self.elements[tp.getAttribute('name')] = tp
            elif component == 'group':
                tp = ModelGroupDefinition(self)
                tp.fromDom(childNode)
                self.model_groups[tp.getAttribute('name')] = tp
            elif component == 'notation':
                tp = Notation(self)
                tp.fromDom(childNode)
                self.notations[tp.getAttribute('name')] = tp
            elif component == 'complexType':
                tp = ComplexType(self)
                tp.fromDom(childNode)
                self.types[tp.getAttribute('name')] = tp
            elif component == 'simpleType':
                tp = SimpleType(self)
                tp.fromDom(childNode)
                self.types[tp.getAttribute('name')] = tp
            else:
                break

    class Import(XMLSchemaComponent):
        """<import> 
           parent:
               schema
           attributes:
               id -- ID
               namespace -- anyURI
               schemaLocation -- anyURI
           contents:
               annotation?
        """
        attributes = {'id':None,
                      'namespace':None,
                      'schemaLocation':None}
        contents = {'xsd':['annotation']}
        tag = 'import'

        def __init__(self, parent):
            XMLSchemaComponent.__init__(self, parent)
            self.annotation = None
            self._schema = None

        def fromDom(self, node):
            self.setAttributes(node)
            contents = self.getContents(node)

            if self.attributes['namespace'] == self.getTargetNamespace():
                raise SchemaError('namespace of schema and import match')

            for i in contents:
                component = SplitQName(i.getTagName())[1]
                if component == 'annotation' and not self.annotation:
                    self.annotation = Annotation(self)
                    self.annotation.fromDom(i)
                else:
                    raise SchemaError('Unknown component (%s)' %(i.getTagName()))

        def getSchema(self):
            """if schema is not defined, first look for a Schema class instance
               in parent Schema.  Else if not defined resolve schemaLocation
               and create a new Schema class instance, and keep a hard reference. 
            """
            if not self._schema:
                ns = self.attributes['namespace']
                schema = self._parent().getImportSchemas().get(ns)
                if not schema and self._parent()._parent:
                    schema = self._parent()._parent().getImportSchemas().get(ns)

                if not schema:
                    url = self.attributes.get('schemaLocation')
                    if not url:
                        raise SchemaError('namespace(%s) is unknown' % ns)
                    base_url = self._parent().getBaseUrl()
                    reader = SchemaReader(base_url=base_url)
                    reader._imports = self._parent().getImportSchemas()
                    reader._includes = self._parent().getIncludeSchemas()
                    self._schema = reader.loadFromURL(url)
            return self._schema or schema
            
        def loadSchema(self, schema):
            """
            """
            base_url = self._parent().getBaseUrl()
            reader = SchemaReader(base_url=base_url)
            reader._imports = self._parent().getImportSchemas()
            reader._includes = self._parent().getIncludeSchemas()
            self._schema = schema

            if 'schemaLocation' not in self.attributes:
                raise NoSchemaLocationWarning('no schemaLocation attribute in import')

            reader.loadFromURL(self.attributes.get('schemaLocation'), schema)


    class Include(XMLSchemaComponent):
        """<include schemaLocation>
           parent:
               schema
           attributes:
               id -- ID
               schemaLocation -- anyURI, required
           contents:
               annotation?
        """
        required = ['schemaLocation']
        attributes = {'id':None,
            'schemaLocation':None}
        contents = {'xsd':['annotation']}
        tag = 'include'

        def __init__(self, parent):
            XMLSchemaComponent.__init__(self, parent)
            self.annotation = None
            self._schema = None

        def fromDom(self, node):
            self.setAttributes(node)
            contents = self.getContents(node)

            for i in contents:
                component = SplitQName(i.getTagName())[1]
                if component == 'annotation' and not self.annotation:
                    self.annotation = Annotation(self)
                    self.annotation.fromDom(i)
                else:
                    raise SchemaError('Unknown component (%s)' %(i.getTagName()))

        def getSchema(self):
            """if schema is not defined, first look for a Schema class instance
               in parent Schema.  Else if not defined resolve schemaLocation
               and create a new Schema class instance.  
            """
            if not self._schema:
                schema = self._parent()
                self._schema = schema.getIncludeSchemas().get(\
                                   self.attributes['schemaLocation']
                                   )
                if not self._schema:
                    url = self.attributes['schemaLocation']
                    reader = SchemaReader(base_url=schema.getBaseUrl())
                    reader._imports = schema.getImportSchemas()
                    reader._includes = schema.getIncludeSchemas()
                    
                    # create schema before loading so chameleon include 
                    # will evalute targetNamespace correctly.
                    self._schema = XMLSchema(schema)
                    reader.loadFromURL(url, self._schema)

            return self._schema class WSDLReader:
class WSDL:
class Element:
class ImportElement(Element):
class Types(Collection):
class Message(Element):
class MessagePart(Element):
class PortType(Element):
class Operation(Element):
class MessageRole(Element):
class Binding(Element):
class OperationBinding(Element):
class MessageRoleBinding(Element):
class Service(Element):
class Port(Element):
class SoapBinding:
class SoapAddressBinding:
class SoapOperationBinding:
class SoapBodyBinding:
class SoapFaultBinding:
class SoapHeaderBinding:
class SoapHeaderFaultBinding(SoapHeaderBinding):
class HttpBinding:
class HttpAddressBinding:
class HttpOperationBinding:
class HttpUrlReplacementBinding:
class HttpUrlEncodedBinding:
class MimeContentBinding:
class MimeXmlBinding:
class MimeMultipartRelatedBinding:
class MimePartBinding:
class WSDLError(Exception):
class SOAPCallInfo:
class ParameterInfo:
class HeaderInfo(ParameterInfo):
    def loadFromStream(self, stream, name=None):
    def loadFromURL(self, url):
    def loadFromString(self, data):
    def loadFromFile(self, filename):
    def __init__(self, targetNamespace=None, strict=1):
    def __del__(self):
    def addService(self, name, documentation='', targetNamespace=None):
    def addMessage(self, name, documentation='', targetNamespace=None):
    def addPortType(self, name, documentation='', targetNamespace=None):
    def addBinding(self, name, _type, documentation='', targetNamespace=None):
    def addImport(self, namespace, location):
    def toDom(self):
    def load(self, document):
    def _import(self, document, element, base_location=None):
    def __init__(self, name=None, documentation=''):
    def addExtension(self, item):
    def getWSDL(self):
    def __init__(self, namespace, location):
    def toDom(self):
    def __init__(self, parent):
    def addSchema(self, schema):
    def addExtension(self, item):
    def __init__(self, name, documentation=''):
    def load(self, elements):
    def toDom(self):
    def __init__(self, name):
    def getTypeDefinition(self):
    def getElementDeclaration(self):
    def toDom(self, node):
    def __init__(self, name, documentation=''):
    def getTargetNamespace(self):
    def getResourceProperties(self):
    def addOperation(self, name, documentation='', parameterOrder=None):
    def load(self, element):
    def toDom(self):
    def __init__(self, name, documentation='', parameterOrder=None):
    def getWSDL(self):
    def getPortType(self):
    def getInputAction(self):
    def getInputMessage(self):
    def getOutputAction(self):
    def getOutputMessage(self):
    def getFaultAction(self, name):
    def getFaultMessage(self, name):
    def addFault(self, message, name, documentation='', action=None):
    def setInput(self, message, name='', documentation='', action=None):
    def setOutput(self, message, name='', documentation='', action=None):
    def toDom(self, node):
    def __init__(self, _type, message, name='', documentation='', action=None):
    def getWSDL(self):
    def getMessage(self):
    def toDom(self, node):
    def __init__(self, name, _type, documentation=''):
    def getPortType(self):
    def findBinding(self, kind):
    def findBindings(self, kind):
    def addOperationBinding(self, name, documentation=''):
    def load(self, elements):
    def load_ex(self, elements):
    def toDom(self):
    def __init__(self, name, documentation=''):
    def getBinding(self):
    def getOperation(self):
    def findBinding(self, kind):
    def findBindings(self, kind):
    def addInputBinding(self, binding):
    def addOutputBinding(self, binding):
    def addFaultBinding(self, name, binding):
    def load_ex(self, elements):
    def toDom(self, node):
    def __init__(self, _type, name='', documentation=''):
    def findBinding(self, kind):
    def findBindings(self, kind):
    def load_ex(self, elements):
    def toDom(self, node):
    def __init__(self, name, documentation=''):
    def getWSDL(self):
    def addPort(self, name, binding, documentation=''):
    def load(self, elements):
    def load_ex(self, elements):
    def toDom(self):
    def __init__(self, name, binding, documentation=''):
    def getService(self):
    def getBinding(self):
    def getPortType(self):
    def getAddressBinding(self):
    def load_ex(self, elements):
    def toDom(self, node):
    def __init__(self, transport, style='rpc'):
    def getWSDL(self):
    def toDom(self, node):
    def __init__(self, location):
    def getWSDL(self):
    def toDom(self, node):
    def __init__(self, soapAction=None, style=None):
    def getWSDL(self):
    def toDom(self, node):
    def __init__(self, use, namespace=None, encodingStyle=None, parts=None):
    def getWSDL(self):
    def toDom(self, node):
    def __init__(self, name, use, namespace=None, encodingStyle=None):
    def getWSDL(self):
    def toDom(self, node):
    def __init__(self, message, part, use, namespace=None, encodingStyle=None):
    def __init__(self, verb):
    def __init__(self, location):
    def __init__(self, location):
    def __init__(self, part=None, _type=None):
    def __init__(self, part=None):
    def __init__(self):
    def load_ex(self, elements):
    def __init__(self):
    def load_ex(self, elements):
def DeclareNSPrefix(writer, prefix, nsuri):
def ParseTypeRef(value, element):
def ParseQName(value, element):
def GetDocumentation(element):
def GetExtensions(element):
def GetWSAActionFault(operation, name):
def GetWSAActionInput(operation):
def GetWSAActionOutput(operation):
def FindExtensions(obj, kind, t_type=type(())):
def FindExtension(obj, kind, t_type=type(())):
    def __init__(self, methodName):
    def addInParameter(self, name, _type, namespace=None, element_type=0):
    def addOutParameter(self, name, _type, namespace=None, element_type=0):
    def setReturnParameter(self, name, _type, namespace=None, element_type=0):
    def addInHeaderInfo(self, name, _type, namespace, element_type=0,
                        mustUnderstand=0):
    def addOutHeaderInfo(self, name, _type, namespace, element_type=0,
                         mustUnderstand=0):
    def getInParameters(self):
    def getOutParameters(self):
    def getReturnParameter(self):
    def getInHeaders(self):
    def getOutHeaders(self):
    def __init__(self, name, _type, namespace=None, element_type=0):
    def __init__(self, name, _type, namespace, element_type=None):
def callInfoFromWSDL(port, name):
        NS_WSDL = DOM.GetWSDLUri(self.version)
        NS_WSDL = DOM.GetWSDLUri(self.getWSDL().version) class SCHEMA:
    XSD1        = "http://www.w3.org/1999/XMLSchema"
    XSD2        = "http://www.w3.org/2000/10/XMLSchema"
    XSD3        = "http://www.w3.org/2001/XMLSchema"
    XSD_LIST    = [ XSD1, XSD2, XSD3]
    XSI1        = "http://www.w3.org/1999/XMLSchema-instance"
    XSI2        = "http://www.w3.org/2000/10/XMLSchema-instance"
    XSI3        = "http://www.w3.org/2001/XMLSchema-instance"
    XSI_LIST    = [ XSI1, XSI2, XSI3 ]
    BASE        = XSD3 class SOAP:
    ENV         = "http://schemas.xmlsoap.org/soap/envelope/"
    ENC         = "http://schemas.xmlsoap.org/soap/encoding/"
    ACTOR_NEXT  = "http://schemas.xmlsoap.org/soap/actor/next" class WSDL:
    BASE        = "http://schemas.xmlsoap.org/wsdl/"
    BIND_HTTP   = "http://schemas.xmlsoap.org/wsdl/http/"
    BIND_MIME   = "http://schemas.xmlsoap.org/wsdl/mime/"
    BIND_SOAP   = "http://schemas.xmlsoap.org/wsdl/soap/"
    BIND_SOAP12 = "http://schemas.xmlsoap.org/wsdl/soap12/" class APACHE:
    '''This name space is defined by AXIS and it is used for the TC in TCapache.py,
    Map and file attachment (DataHandler)
    '''
    AXIS_NS = "http://xml.apache.org/xml-soap" def getLogger(msg):
    '''Return instance of Logging class.
    '''
    return _LoggerClass(msg) class BaseTypeInterpreter:
    """Example mapping of xsd/soapenc types to zsi python types.
    Checks against all available classes in ZSI.TC.  Used in
    wsdl2python, wsdlInterpreter, and ServiceProxy.
    """

    def __init__(self):
        self._type_list = [TC.Iinteger, TC.IunsignedShort, TC.gYearMonth, \
                           TC.InonNegativeInteger, TC.Iint, TC.String, \
                           TC.gDateTime, TC.IunsignedInt, TC.Duration,\
                           TC.IpositiveInteger, TC.FPfloat, TC.gDay, TC.gMonth, \
                           TC.InegativeInteger, TC.gDate, TC.URI, \
                           TC.HexBinaryString, TC.IunsignedByte, \
                           TC.gMonthDay, TC.InonPositiveInteger, \
                           TC.Ibyte, TC.FPdouble, TC.gTime, TC.gYear, \
                           TC.Ilong, TC.IunsignedLong, TC.Ishort, \
                           TC.Token, TC.QName, ZSI.TCapache.AttachmentRef]

        self._tc_to_int = [
            ZSI.TCnumbers.IEnumeration,
            ZSI.TCnumbers.Iint,
            ZSI.TCnumbers.Iinteger,
            ZSI.TCnumbers.Ilong,
            ZSI.TCnumbers.InegativeInteger,
            ZSI.TCnumbers.InonNegativeInteger,
            ZSI.TCnumbers.InonPositiveInteger,
            ZSI.TC.Integer,
            ZSI.TCnumbers.IpositiveInteger,
            ZSI.TCnumbers.Ishort]

        self._tc_to_float = [
            ZSI.TC.Decimal,
            ZSI.TCnumbers.FPEnumeration,
            ZSI.TCnumbers.FPdouble,
            ZSI.TCnumbers.FPfloat]

        self._tc_to_string = [
            ZSI.TC.Base64String,
            ZSI.TC.Enumeration,
            ZSI.TC.HexBinaryString,
            ZSI.TCnumbers.Ibyte,
            ZSI.TCnumbers.IunsignedByte,
            ZSI.TCnumbers.IunsignedInt,
            ZSI.TCnumbers.IunsignedLong,
            ZSI.TCnumbers.IunsignedShort,
            ZSI.TC.String,
            ZSI.TC.URI,
            ZSI.TC.XMLString,
            ZSI.TC.Token,
            ZSI.TCapache.AttachmentRef]

        self._tc_to_tuple = [
            ZSI.TC.Duration,
            ZSI.TC.QName,
            ZSI.TCtimes.gDate,
            ZSI.TCtimes.gDateTime,
            ZSI.TCtimes.gDay,
            ZSI.TCtimes.gMonthDay,
            ZSI.TCtimes.gTime,
            ZSI.TCtimes.gYear,
            ZSI.TCtimes.gMonth,
            ZSI.TCtimes.gYearMonth]

        return

    def _get_xsd_typecode(self, msg_type):
        untaged_xsd_types = {'boolean':TC.Boolean,
            'decimal':TC.Decimal,
            'base64Binary':TC.Base64String}
        if msg_type in untaged_xsd_types:
            return untaged_xsd_types[msg_type]
        for tc in self._type_list:
            if tc.type == (SCHEMA.XSD3,msg_type):
                break
        else:
            tc = TC.AnyType
        return tc

    def _get_soapenc_typecode(self, msg_type):
        if msg_type == 'Array':
            return TCcompound.Array
        if msg_type == 'Struct':
            return TCcompound.Struct

        return self._get_xsd_typecode(msg_type)

    def get_typeclass(self, msg_type, targetNamespace):
        _, name = SplitQName(msg_type)
        if targetNamespace in SCHEMA.XSD_LIST:
            return self._get_xsd_typecode(name)
        elif targetNamespace in [SOAP.ENC]:
            return self._get_soapenc_typecode(name)
        elif targetNamespace in  [ZSI.TCapache.Apache.NS]:
            #maybe we have an AXIS attachment
            if name == ZSI.TCapache.AttachmentRef.type[1]:
                #we have an AXIS attachment
                return ZSI.TCapache.AttachmentRef
            else:
                #AXIS Map type
                return TC.AnyType
        return None

    def get_pythontype(self, msg_type, targetNamespace, typeclass=None):
        if not typeclass:
            tc = self.get_typeclass(msg_type, targetNamespace)
        else:
            tc = typeclass
        if tc in self._tc_to_int:
            return 'int'
        elif tc in self._tc_to_float:
            return 'float'
        elif tc in self._tc_to_string:
            return 'str'
        elif tc in self._tc_to_tuple:
            return 'tuple'
        elif tc in [TCcompound.Array]:
            return 'list'
        elif tc in [TC.Boolean]:
            return 'bool'
        elif isinstance(tc, TypeCode):
            raise EvaluateException('failed to map zsi typecode to a python type')
        return None
import types, warnings
import pysphere.ZSI
from pysphere.ZSI.generate.utility import StringWriter, TextProtect, TextProtectAttributeName,\
    GetPartsSubNames
from pysphere.ZSI.generate.utility import NamespaceAliasDict as NAD, NCName_to_ClassName as NC_to_CN
from pysphere.ZSI.TC import _is_xsd_or_soap_ns
from pysphere.ZSI.wstools import XMLSchema, WSDLTools
from pysphere.ZSI.wstools.Namespaces import SCHEMA, SOAP, WSDL, APACHE
from pysphere.ZSI.wstools.logging import getLogger as _GetLogger
from pysphere.ZSI.typeinterpreter import BaseTypeInterpreter
from pysphere.ZSI.generate import WSISpec, WSInteropError, Wsdl2PythonError,\
    WsdlGeneratorError, WSDLFormatError
                    +"and all element attributes (<message><part element="\
                    +"\"my:GED\"></message>) must refer to single global "\
                    +"element declaration with complexType content.  "\
                    +"\n\n**** TRY WITHOUT EXTENDED ****\n")

            args = []
            for pa in subNames:
                args += pa

            for arg in args:
                wrap_str += "%srequest.%s = %s\n" % (ID2,
                                                     self.getAttributeName(arg),
                                                     self.mangle(arg))

            #args = [pa.name for pa in self.getOperation().getInputMessage().parts.values()]
            argsStr = ",".join(args)
            if len(argsStr) > 1: # add inital comma if args exist
                argsStr = ", " + argsStr

            method = [
                '%s# op: %s' % (ID1, self.getOperation().getInputMessage()),
                '%sdef %s(self%s):' % (ID1, self.name, argsStr),
                '\n%srequest = %s()' % (ID2, self.inputName),
                '%s' % (wrap_str),
                '%s%s' % (ID2, kwstring),
                '%s%s' % (ID2, wsactionIn),
                '%sself.binding.Send(None, None, request, soapaction="%s", %s'\
                %(ID2, self.soapaction, bindArgs),
            ]
        elif self.soap_input_headers:
            method = [
                '%s# op: %s' % (ID1, self.name),
                '%sdef %s(self, request, soapheaders=(), **kw):' % (ID1, self.name),
                '%s%s' % (ID2, tCheck),
                '%sraise TypeError("%%s incorrect request type" %% (%s))' %(ID3, 'request.__class__'),
                '%s%s' % (ID2, wsactionIn),
                '%s# TODO: Check soapheaders' % (ID2),
                '%sself.binding.Send(None, None, request, soapaction="%s", soapheaders=soapheaders, %s'\
                %(ID2, self.soapaction, bindArgs),
            ]
        else:
            method = [
                '%s# op: %s' % (ID1, self.name),
                '%sdef %s(self, request, **kw):' % (ID1, self.name),
                '%s%s' % (ID2, tCheck),
                '%sraise TypeError("%%s incorrect request type" %% (%s))' %(ID3, 'request.__class__'),
                '%s%s' % (ID2, wsactionIn),
                '%sself.binding.Send(None, None, request, soapaction="%s", %s'\
                %(ID2, self.soapaction, bindArgs),
            ]
        #
        # BP 1.0: rpc/literal
        # WSDL 1.1 Section 3.5 could be interpreted to mean the RPC response
        # wrapper element must be named identical to the name of the
        # wsdl:operation.
        # R2729

        #
        # SOAP-1.1 Note: rpc/encoded
        # Each parameter accessor has a name corresponding to the name of the
        # parameter and type corresponding to the type of the parameter. The name of
        # the return value accessor is not significant. Likewise, the name of the struct is
        # not significant. However, a convention is to name it after the method name
        # with the string "Response" appended.
        #
        if not self.outputName:
            method.append('%s#check for soap, assume soap:fault' %(ID2,))
            method.append('%sif self.binding.IsSOAP(): self.binding.Receive(None, **kw)' % (ID2,))
            self.writeArray(method)
            return

        response = ['%s%s' % (ID2, wsactionOut),]
        if self.isRPC() and not self.isLiteral():
            # rpc/encoded Replace wrapper name with None
            response.append(\
                '%stypecode = Struct(pname=None, ofwhat=%s.typecode.ofwhat, pyclass=%s.typecode.pyclass)' %(
                     ID2, self.outputName, self.outputName)
                )
            response.append(\
                '%sresponse = self.binding.Receive(typecode%s)' %(
                     ID2, responseArgs)
                )
        else:
            response.append(\
                '%sresponse = self.binding.Receive(%s.typecode%s)' %(
                     ID2, self.outputName, responseArgs)
                )

        # only support lit
        if self.soap_output_headers:
            sh = '['
            for shb in self.soap_output_headers:
                #shb.encodingStyle, shb.use, shb.namespace
                shb.message
                shb.part
                try:
                    msg = self._wsdl.messages[shb.message]
                    part = msg.parts[shb.part]
                    if part.element is not None:
                        sh += 'GED%s,' %str(part.element)
                    else:
                        warnings.warn('skipping soap output header in Message "%s"' %str(msg))
                except:
                    raise WSDLFormatError(
                      'failure processing output header typecodes, ' +
                      'could not find message "%s" or its part "%s"' %(
                               shb.message, shb.part)
                    )

            sh += ']'
            if len(sh) > 2:
                response.append(\
                '%sself.soapheaders = self.binding.ps.ParseHeaderElements(%s)' %(ID2, sh)
                )

        if self.outputSimpleType:
            response.append('%sreturn %s(response)' %(ID2, self.outputName))
        else:
            if self.do_extended:
                partsList = self.getOperation().getOutputMessage().parts.itervalues()

                subNames = GetPartsSubNames(partsList, self._wsdl)