在尝试使用SozUI(如mozila海报,Google restclient应用程序或我的.net代码)调用我的Amadeus Fare_masterpricetravelboard服务时,它会返回以下错误消息:
表示消息寻址属性的标头无效且无法处理消息
同样的Web服务在SOAP UI工具中运行良好。
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sec="http://xml.amadeus.com/2010/06/Security_v1" xmlns:typ="http://xml.amadeus.com/2010/06/Types_v1" xmlns:iat="http://www.iata.org/IATA/2007/00/IATA2010.1" xmlns:app="http://xml.amadeus.com/2010/06/AppMdw_CommonTypes_v3" xmlns:link="http://wsdl.amadeus.com/2010/06/ws/Link_v1" xmlns:ses="http://xml.amadeus.com/2010/06/Session_v3" xmlns:fmp="http://xml.amadeus.com/FMPTBQ_10_3_1A">
<soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
<add:MessageID xmlns:add="http://www.w3.org/2005/08/addressing">65449120-2aa0-46b0-9dcc-c40c6439836c</add:MessageID>
<wsa:Action>http://webservices.amadeus.com/FMPTBQ_10_3_1A</wsa:Action>
<add:To xmlns:add="http://www.w3.org/2005/08/addressing">https://nodeD1.test.webservices.amadeus.com/1ASIWIBEWWZ</add:To>
<link:TransactionFlowLink xmlns:link="http://wsdl.amadeus.com/2010/06/ws/Link_v1" />
<oas:Security xmlns:oas="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<oas:UsernameToken oas1:Id="UsernameToken-1" xmlns:oas1="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<oas:Username>WSWWZIBE</oas:Username>
<oas:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">EoCeDbDbThB=</oas:Nonce>
<oas:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">Hr2HRG8j0dTH19kh52wQ5aqMxhU=</oas:Password>
<oas1:Created>2014-07-19T12:33:47:530Z</oas1:Created>
</oas:UsernameToken>
</oas:Security>
<AMA_SecurityHostedUser xmlns="http://xml.amadeus.com/2010/06/Security_v1">
<UserID POS_Type="1" PseudoCityCode="THRI4213V" RequestorType="U" />
</AMA_SecurityHostedUser>
</soapenv:Header>
<soapenv:Body>
<Fare_MasterPricerTravelBoardSearch>
<numberOfUnit>
<unitNumberDetail>
<numberOfUnits>1</numberOfUnits>
<typeOfUnit>PX</typeOfUnit>
</unitNumberDetail>
<unitNumberDetail>
<numberOfUnits>250</numberOfUnits>
<typeOfUnit>RC</typeOfUnit>
</unitNumberDetail>
</numberOfUnit>
<paxReference>
<ptc>ADT</ptc>
<traveller>
<ref>1</ref>
</traveller>
</paxReference>
<fareOptions>
<pricingTickInfo>
<pricingTicketing>
<priceType>RP</priceType>
<priceType>RU</priceType>
<priceType>TAC</priceType>
</pricingTicketing>
</pricingTickInfo>
</fareOptions>
<itinerary>
<requestedSegmentRef>
<segRef>1</segRef>
</requestedSegmentRef>
<departureLocalization>
<departurePoint>
<locationId>CDG</locationId>
</departurePoint>
</departureLocalization>
<arrivalLocalization>
<arrivalPointDetails>
<locationId>LHR</locationId>
</arrivalPointDetails>
</arrivalLocalization>
<timeDetails>
<firstDateTimeDetail>
<timeQualifier>TA</timeQualifier>
<date>041114</date>
<time>2200</time>
<timeWindow>4</timeWindow>
</firstDateTimeDetail>
<rangeOfDate>
<rangeQualifier>C</rangeQualifier>
<dayInterval>1</dayInterval>
</rangeOfDate>
</timeDetails>
</itinerary>
</Fare_MasterPricerTravelBoardSearch>
</soapenv:Body>
</soapenv:Envelope>
响应:
<soap:Envelope>
<soap:Header>
<wsa:Action>http://www.w3.org/2005/08/addressing/fault</wsa:Action>
<wsa:MessageID>urn:uuid:0ce4ebc0-7753-6394-4945-c7e8f81c2c49</wsa:MessageID>
<wsa:RelatesTo RelationshipType="http://www.w3.org/2005/08/addressing/reply">65449120-2aa0-46b0-9dcc-c40c6439836c</wsa:RelatesTo>
<wsa:FaultDetail>
<wsa:ProblemHeaderQName>wsa:To</wsa:ProblemHeaderQName>
<wsa:ProblemIRI>https://nodeD1.test.webservices.amadeus.com/1ASIWIBEWWZ</wsa:ProblemIRI>
</wsa:FaultDetail>
</soap:Header>
<soap:Body>
<soap:Fault>
<faultcode>wsa:InvalidAddressingHeader</faultcode>
<faultstring>A header representing a Message Addressing Property is not valid and the message cannot be processed</faultstring>
<faultactor>SI:muxDZ1</faultactor>
</soap:Fault>
</soap:Body>
</soap:Envelope>
答案 0 :(得分:11)
确保网络请求的网址与“add:To”标记的值相匹配,包括字母大小写。
可能你正在开发.net,即使你在同一个字母的情况下设置了url,请求也会以小写形式发送到地址。所以 nodeD1 在http层中变为 noded1 ,但在soap信封中仍然是nodeD1。小心在两个字段中使用小写或大写