【问题标题】:Stateful Amadeus Soap Header 4 Request in PostmanPostman 中的有状态 Amadeus Soap 标头 4 请求
【发布时间】:2018-09-03 09:38:44
【问题描述】:

我正在尝试使用 https://www.getpostman.com/ 通过 amadeus soap api 进行通信。所以我确实按照他们的文档状态构建了我的 Soap Header v4 Request,但是我最终总是收到 SoapFault "11|Session|"

在这种情况下,我还将 HTTP-Header SOAPAction 设置为 http://webservices.amadeus.com/VLSSLQ_06_1_1A

当我使用像https://github.com/amabnl/amadeus-ws-client 这样的客户端时,这是可行的,但是当尝试使用邮递员发出相同的请求时,它却没有,有什么想法吗?

请求

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
                   xmlns:ns1="http://xml.amadeus.com/VLSSLQ_06_1_1A"
                   xmlns:ns2="http://www.w3.org/2005/08/addressing"
                   xmlns:ns3="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wsswssecurity-secext-1.0.xsd"
                   xmlns:ns4="http://xml.amadeus.com/2010/06/Session_v3"
                   xmlns:ns5="http://xml.amadeus.com/2010/06/Security_v1">
    <SOAP-ENV:Header>
        <ns2:MessageID>x-x-x-x-x</ns2:MessageID>
        <ns2:Action>http://webservices.amadeus.com/VLSSLQ_06_1_1A</ns2:Action>
        <ns2:To>https://nodeD1.test.webservices.amadeus.com/AAAAAAAAA</ns2:To>
        <oas:Security xmlns:oas="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
            <oas:UsernameToken xmlns:oas1="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" oas1:Id="UsernameToken-1">
                <oas:Username>AAAAAAAAA</oas:Username>
                <oas:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">aaaaaa==</oas:Nonce>
                <oas:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">aaaaa=</oas:Password>
                <oas1:Created>2018-08-28T08:46:39:293Z</oas1:Created>
            </oas:UsernameToken>
        </oas:Security>
        <ns4:Session TransactionStatusCode="Start"/>
        <ns5:AMA_SecurityHostedUser>
            <ns5:UserID POS_Type="1" PseudoCityCode="AABBBCCDDEE" AgentDutyCode="AA" RequestorType="U"/>
        </ns5:AMA_SecurityHostedUser>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
        <!-- actual request -->
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

响应

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:awsse="http://xml.amadeus.com/2010/06/Session_v3" xmlns:wsa="http://www.w3.org/2005/08/addressing">
    <soap:Header>
        <wsa:To>http://www.w3.org/2005/08/addressing/anonymous</wsa:To>
        <wsa:From>
            <wsa:Address>https://nodeD1.test.webservices.amadeus.com/AAAAAAAAA</wsa:Address>
        </wsa:From>
        <wsa:Action>http://webservices.amadeus.com/VLSSLQ_06_1_1A</wsa:Action>
        <wsa:MessageID>urn:uuid:x-x-x-x-x</wsa:MessageID>
        <wsa:RelatesTo RelationshipType="http://www.w3.org/2005/08/addressing/reply">yyyyyy-xxxxx</wsa:RelatesTo>
        <awsse:Session TransactionStatusCode="End">
            <awsse:SessionId>xxxxx</awsse:SessionId>
            <awsse:SequenceNumber>1</awsse:SequenceNumber>
            <awsse:SecurityToken>xxxxx</awsse:SecurityToken>
        </awsse:Session>
    </soap:Header>
    <soap:Body>
        <soap:Fault>
            <faultcode>soap:Client</faultcode>
            <faultstring> 11|Session|</faultstring>
        </soap:Fault>
    </soap:Body>
</soap:Envelope>

【问题讨论】:

    标签: xml web-services soap amadeus


    【解决方案1】:

    由于您收到11|Session| 错误,这意味着您发送的数据不正确。 您需要检查的几件事。

    • “Zulu”时区的日期时间,因为 Amadeus 将时间验证到他们的时间,因此只允许 30 分钟的时差。
    • 密码摘要算法。
    • 在 30 分钟内使用相同的 nonce。

    【讨论】:

    • 感谢您的建议!
    【解决方案2】:

    我发现这里出了什么问题,我在 Security_Authenticated 请求本身的正文中使用了 Soap-Header (v4) AND 中的安全信息。

    我删除了所有安全标头,这样它工作得很好,所以工作请求看起来像:

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
                   xmlns:ns1="http://xml.amadeus.com/VLSSLQ_06_1_1A" xmlns:ns2="http://www.w3.org/2005/08/addressing"
                   xmlns:ns3="http://xml.amadeus.com/2010/06/Session_v3">
    <SOAP-ENV:Header>
        <ns2:MessageID>X</ns2:MessageID>
        <ns2:Action>http://webservices.amadeus.com/VLSSLQ_06_1_1A</ns2:Action>
        <ns2:To>X</ns2:To>
        <ns3:Session TransactionStatusCode="Start">
        </ns3:Session>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
        <ns1:Security_Authenticate>
            <ns1:userIdentifier>
                <ns1:originIdentification>
                    <ns1:sourceOffice>X</ns1:sourceOffice>
                </ns1:originIdentification>
                <ns1:originatorTypeCode>x</ns1:originatorTypeCode>
                <ns1:originator>X</ns1:originator>
            </ns1:userIdentifier>
            <ns1:dutyCode>
                <ns1:dutyCodeDetails>
                    <ns1:referenceQualifier>X</ns1:referenceQualifier>
                    <ns1:referenceIdentifier>X</ns1:referenceIdentifier>
                </ns1:dutyCodeDetails>
            </ns1:dutyCode>
            <ns1:systemDetails>
                <ns1:organizationDetails>
                    <ns1:organizationId>X</ns1:organizationId>
                </ns1:organizationDetails>
            </ns1:systemDetails>
            <ns1:passwordInfo>
                <ns1:dataLength>0</ns1:dataLength>
                <ns1:dataType>X</ns1:dataType>
                <ns1:binaryData>X</ns1:binaryData>
            </ns1:passwordInfo>
        </ns1:Security_Authenticate>
    </SOAP-ENV:Body>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-10-27
      • 1970-01-01
      • 1970-01-01
      • 2015-11-02
      • 1970-01-01
      相关资源
      最近更新 更多