为什么会话在收到身份验证请求的响应后立即过期?
我按照此处所述https://developer.sabre.com/docs/read/soap_basics/Authentication获取二进制令牌。从那里获得令牌后,我使用相同的令牌来搜索航班,但我得到的错误如下:`
com.sabre.universalservices.base.security.AuthenticationException: errors.session.USG_INVALID_SECURITY_TOKEN
`
我搜索航班的代码是:
$wsdl = "http://webservices.sabre.com/wsdl/tpfc/OTA_AirAvailLLS2.3.0RQ.wsdl";
$sabreSoapServer = "https://webservices3.sabre.com";
$xml='<?xml version="1.0" encoding="UTF-8" ?>
<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">localhost/sabre</eb:PartyId>
</eb:From>
<eb:To>
<eb:PartyId eb:type="urn:x12.org:IO5:01">sabre</eb:PartyId>
</eb:To>
<eb:CPAId>3W2D</eb:CPAId>
<eb:ConversationId>testingId</eb:ConversationId>
<eb:Service eb:type="sabreXML">"OTA_AirAvailService</eb:Service>
<eb:Action>OTA_AirAvailLLSRQ</eb:Action>
<eb:MessageData>
<eb:MessageId>1426190858</eb:MessageId>
<eb:Timestamp>2016-01-24T03:21:00+05:45</eb:Timestamp>
<eb:TimeToLive>2016-01-24T04:21:00+05:45</eb:TimeToLive>
</eb:MessageData>
<wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext">
<wsse:BinarySecurityToken>Shared/IDL:IceSess\/SessMgr:1\.0.IDL/Common/!ICESMS\/RESB!ICESMSLB\/RES.LB!-3444664992093836124!1921249!0</wsse:BinarySecurityToken>
</wsse:Security>
</eb:MessageHeader>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<OTA_AirAvailRQ Version="2.2.0" xmlns="http://webservices.sabre.com/sabreXML/2011/10" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<OriginDestinationInformation>
<FlightSegment DepartureDateTime="12-21">
<DestinationLocation LocationCode="DFW"/>
<OriginLocation LocationCode="HNL"/>
</FlightSegment>
</OriginDestinationInformation>
</OTA_AirAvailRQ>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>';
$client = new SoapClient($wsdl);
$response = $client->__doRequest($xml,$sabreSoapServer,$sabreSoapServer,'1');
$xml = simplexml_load_string($response , NULL , NULL , "http://schemas.xmlsoap.org/soap/envelope/");
print_r($xml);
回复:
<?xml version="1.0" encoding="UTF-8"?>
<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" eb:version="1.0" soap-env:mustUnderstand="1">
<eb:From>
<eb:PartyId eb:type="urn:x12.org:IO5:01">sabre</eb:PartyId>
</eb:From>
<eb:To>
<eb:PartyId eb:type="urn:x12.org:IO5:01">localhost/sabre</eb:PartyId>
</eb:To>
<eb:CPAId>3W2D</eb:CPAId>
<eb:ConversationId>testingId</eb:ConversationId>
<eb:Service eb:type="sabreXML">"OTA_AirAvailService</eb:Service>
<eb:Action>ErrorRS</eb:Action>
<eb:MessageData>
<eb:MessageId>506560ad-1ab6-4dfb-9b54-f26cef3e6658@20</eb:MessageId>
<eb:Timestamp>2016-01-24T09:28:54</eb:Timestamp>
<eb:RefToMessageId>1426190858</eb:RefToMessageId>
</eb:MessageData>
</eb:MessageHeader>
<wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext"/>
</soap-env:Header>
<soap-env:Body>
<soap-env:Fault>
<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>