我正在尝试使用https://www.getpostman.com/与amadeus soap api进行通信。所以我确实按照他们的文档说明建立了Soap Header v4请求,但是我总是最终收到一个SoapFault“ 11 | Session |”
在这种情况下,我还将HTTP标头 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>
答案 0 :(得分:0)
由于收到11|Session|
错误,这意味着您发送的数据不正确。
您需要检查的几件事。
答案 1 :(得分:0)
我发现这里出了什么问题,我在正文中的Soap-Header(v4) AND 中使用了安全性信息作为Security_Authenticated请求本身。
我删除了所有Security-Header,这样它就可以正常工作,因此工作请求如下:
<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>