Did I find the right examples for you? yes no

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)
:param text: SOAP message
:return: dictionary with two keys "body"/"header"

        def open_soap_envelope(text):
    """

    :param text: SOAP message
    :return: dictionary with two keys "body"/"header"
    """
    try:
        envelope = ElementTree.fromstring(text)
    except Exception, exc:
        raise XmlParseError("%s" % exc)

    assert envelope.tag == '{%s}Envelope' % soapenv.NAMESPACE
    assert len(envelope) >= 1
    content = {"header": [], "body": None}

    for part in envelope:
        if part.tag == '{%s}Body' % soapenv.NAMESPACE:
            assert len(part) == 1
            content["body"] = ElementTree.tostring(part[0], encoding="UTF-8")
        elif part.tag == "{%s}Header" % soapenv.NAMESPACE:
            for item in part:
                _str = ElementTree.tostring(item, encoding="UTF-8")
                content["header"].append(_str)

    return content
        


src/p/y/pysaml2-2.0.0/src/saml2/entity.py   pysaml2(Download)
from saml2.soap import parse_soap_enveloped_saml_artifact_resolve
from saml2.soap import class_instances_from_soap_enveloped_saml_thingies
from saml2.soap import open_soap_envelope
 
from saml2 import samlp, SamlBase, SAMLError
        :return: A dictionary with two keys "body"/"header"
        """
        return open_soap_envelope(text)
 
# --------------------------------------------------------------------------

src/p/y/pysaml2-HEAD/src/saml2/entity.py   pysaml2(Download)
from saml2.soap import parse_soap_enveloped_saml_artifact_resolve
from saml2.soap import class_instances_from_soap_enveloped_saml_thingies
from saml2.soap import open_soap_envelope
 
from saml2 import samlp
        :return: A dictionary with two keys "body"/"header"
        """
        return open_soap_envelope(text)
 
# --------------------------------------------------------------------------