我收到以下錯誤消息軍刀 - 酒店預訂API - 錯誤
<faultcode>soap-env:Client.InvalidSecurityToken</faultcode><faultstring>Invalid or Expired binary security token: null</faultstring><detail><StackTrace>com.sabre.universalservices.base.security.AuthenticationException: errors.session.USG_INVALID_SECURITY_TOKEN</StackTrace></detail></soap-env:Fault></soap-env:Body></soap-env:Envelope>
以下是我的要求酒店供應API。
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header>
<eb:MessageHeader xmlns:eb="http://www.ebxml.org/namespaces/messageHeader" SOAP-ENV:mustUnderstand="0">
<eb:From>
<eb:PartyId eb:type="urn:x12.org:IO5:01">client</eb:PartyId>
</eb:From>
<eb:To>
<eb:PartyId eb:type="urn:x12.org:IO5:01">ws</eb:PartyId>
</eb:To>
<eb:CPAId>'.$pcc.'</eb:CPAId>
<eb:ConversationId>YourConversationId</eb:ConversationId>
<eb:Service eb:type="sabreXML"></eb:Service>
<eb:Action>OTA_HotelAvailLLSRQ</eb:Action>
</eb:MessageHeader>
<Security xmlns:ns6="http://schemas.xmlsoap.org/ws/2002/12/secext" SOAP-ENV:mustUnderstand="0">
<BinarySecurityToken>'.$sabreKey.'</BinarySecurityToken>
</Security>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<eb:OTA_HotelAvailRQ xmlns:eb="http://webservices.sabre.com/sabreXML/2003/07" TimeStamp="2011-01-26T12:30:00-06:00" Version="1.10.1">
<eb:POS>
<eb:Source PseudoCityCode="'.$pcc.'" /></eb:POS>
<eb:AvailRequestSegments>
<eb:AvailRequestSegment>
<eb:StayDateRange Start="12-10" End="12-15" />
<eb:RoomStayCandidates>
<eb:RoomStayCandidate>
<eb:GuestCounts>
<eb:GuestCount Count="1" /></eb:GuestCounts>
</eb:RoomStayCandidate>
</eb:RoomStayCandidates>
<eb:HotelSearchCriteria xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="eb:HotelSearchCriteria_type0">
<eb:Criterion>
<eb:HotelRef HotelCityCode="DFW" /></eb:Criterion>
</eb:HotelSearchCriteria>
</eb:AvailRequestSegment>
</eb:AvailRequestSegments>
</eb:OTA_HotelAvailRQ>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
這是我發出請求到酒店預訂API之前做了什麼。我收到了我的wsse:來自SessionCreateRQ的BinarySecurityToken將包含該令牌的變量存儲到。
<BinarySecurityToken>'.$sabreKey.'</BinarySecurityToken>
爲什麼我得到這個錯誤消息我的憑據是正確的。順便說一句,我有生產證書。
謝謝,我很期待一些幫助
感謝您的回覆。布魯諾。這兩個請求都被髮送到同一端點。我找出問題所在,那不是它。我會在幾分鐘後發佈解決方案,因爲我確信我的解決方案將有助於很多未來面臨同樣問題的人。 –