Zeed(Python / SOAP):添加肥皂标题

时间:2018-08-20 11:34:07

标签: soap header zeep

我正在使用Zeep处理我的Soap请求。效果很好。

但是现在我需要向请求添加标头:

saml1 = """
        <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
            <saml1:Assertion AssertionID="12345678" Issuer="toletum.org" MajorVersion="1" MinorVersion="1" xmlns:saml1="urn:oasis:names:tc:SAML:1.0:assertion" xsi:type="saml1:AssertionType" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <saml1:Conditions/>
                <saml1:AuthenticationStatement AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:password" xsi:type="saml1:AuthenticationStatementType">
                    <saml1:Subject>
                        <saml1:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified">TOLETUM</saml1:NameIdentifier>
                        <saml1:SubjectConfirmation>
                            <saml1:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:sender-vouches</saml1:ConfirmationMethod>
                        </saml1:SubjectConfirmation>
                    </saml1:Subject>
                </saml1:AuthenticationStatement>
            </saml1:Assertion>
        </wsse:Security>
"""

如何获取这些标头?

谢谢

0 个答案:

没有答案