mvantellingen / python-zeep

A Python SOAP client
http://docs.python-zeep.org
Other
1.88k stars 586 forks source link

Invalid tag name 'IntegerResult ' #1343

Open Puneeth950 opened 2 years ago

Puneeth950 commented 2 years ago

I'm trying to run WSDL Soap URL using zeep.Client(wsdlurl) which gives the response as below in which one of the message part name contains a trailing space.

`

`

Whereas in Zeep > Util.py there is already a validation performed to take out any trailing spaces from WSDL. As below.

`def as_qname(value: str, nsmap, target_namespace=None) -> etree.QName: """Convert the given value to a QName""" value = value.strip() # some xsd's contain leading/trailing spaces if ":" in value: prefix, local = value.split(":")

    # The xml: prefix is always bound to the XML namespace, see
    # https://www.w3.org/TR/xml-names/
    if prefix == "xml":
        namespace = "http://www.w3.org/XML/1998/namespace"
    else:
        namespace = nsmap.get(prefix)

    if not namespace:
        raise XMLParseError("No namespace defined for %r (%r)" % (prefix, value))

    # Workaround for https://github.com/mvantellingen/python-zeep/issues/349
    if not local:
        return etree.QName(XSD, "anyType")

    return etree.QName(namespace, local)

if target_namespace:
    return etree.QName(target_namespace, value)

if nsmap.get(None):
    return etree.QName(nsmap[None], value)
return etree.QName(value)`

but, this is not helping in removing the trailing space. Please help me to resolve this problem