Invalid or Expired binary security token: null
<p><strong>Why session is expired immediately after getting the response from the Authentication request?</strong> <br /><br />I get the binary token as described here <a href="https://developer.sabre.com/docs/read/soap_basics/Authentication" rel="nofollow">https://developer.sabre.com/docs/read/soap_basics/Authentication</a> . After getting token from there , I am using the  same token to search the flight but I get error like : `</p>

<blockquote>
  <p>com.sabre.universalservices.base.security.AuthenticationException:
  errors.session.USG_INVALID_SECURITY_TOKEN</p>
</blockquote>

<p>`</p>

<p>My code to search the flight is : </p>

<pre><code>$wsdl = "http://webservices.sabre.com/wsdl/tpfc/OTA_AirAvailLLS2.3.0RQ.wsdl";
$sabreSoapServer = "https://webservices3.sabre.com";

$xml='&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
    &lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"&gt;
        &lt;SOAP-ENV:Header&gt;
            &lt;eb:MessageHeader xmlns:eb="http://www.ebxml.org/namespaces/messageHeader" SOAP-ENV:mustUnderstand="0"&gt;
                &lt;eb:From&gt;
                    &lt;eb:PartyId eb:type="urn:x12.org:IO5:01"&gt;localhost/sabre&lt;/eb:PartyId&gt;
                &lt;/eb:From&gt;
                &lt;eb:To&gt;
                    &lt;eb:PartyId eb:type="urn:x12.org:IO5:01"&gt;sabre&lt;/eb:PartyId&gt;
                &lt;/eb:To&gt;
                &lt;eb:CPAId&gt;3W2D&lt;/eb:CPAId&gt;
                &lt;eb:ConversationId&gt;testingId&lt;/eb:ConversationId&gt;
                &lt;eb:Service eb:type="sabreXML"&gt;"OTA_AirAvailService&lt;/eb:Service&gt;
                &lt;eb:Action&gt;OTA_AirAvailLLSRQ&lt;/eb:Action&gt;
                &lt;eb:MessageData&gt;
                    &lt;eb:MessageId&gt;1426190858&lt;/eb:MessageId&gt;
                     &lt;eb:Timestamp&gt;2016-01-24T03:21:00+05:45&lt;/eb:Timestamp&gt;
                    &lt;eb:TimeToLive&gt;2016-01-24T04:21:00+05:45&lt;/eb:TimeToLive&gt;
               &lt;/eb:MessageData&gt;

               &lt;wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext"&gt;

                  &lt;wsse:BinarySecurityToken&gt;Shared/IDL:IceSess\/SessMgr:1\.0.IDL/Common/!ICESMS\/RESB!ICESMSLB\/RES.LB!-3444664992093836124!1921249!0&lt;/wsse:BinarySecurityToken&gt;

                &lt;/wsse:Security&gt;


            &lt;/eb:MessageHeader&gt; 
        &lt;/SOAP-ENV:Header&gt;
        &lt;SOAP-ENV:Body&gt;
            &lt;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"&gt; 
              &lt;OriginDestinationInformation&gt; 
                  &lt;FlightSegment DepartureDateTime="12-21"&gt; 
                      &lt;DestinationLocation LocationCode="DFW"/&gt; 
                      &lt;OriginLocation LocationCode="HNL"/&gt; 
                  &lt;/FlightSegment&gt; 
              &lt;/OriginDestinationInformation&gt; 
          &lt;/OTA_AirAvailRQ&gt; 
        &lt;/SOAP-ENV:Body&gt;
    &lt;/SOAP-ENV:Envelope&gt;';


   $client = new SoapClient($wsdl);
   $response = $client-&gt;__doRequest($xml,$sabreSoapServer,$sabreSoapServer,'1');  
   $xml = simplexml_load_string($response , NULL , NULL , "http://schemas.xmlsoap.org/soap/envelope/");
   print_r($xml);
</code></pre>

<p><strong>Response :</strong> </p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"&gt;
    &lt;soap-env:Header&gt;
        &lt;eb:MessageHeader xmlns:eb="http://www.ebxml.org/namespaces/messageHeader" eb:version="1.0" soap-env:mustUnderstand="1"&gt;
            &lt;eb:From&gt;
                &lt;eb:PartyId eb:type="urn:x12.org:IO5:01"&gt;sabre&lt;/eb:PartyId&gt;
            &lt;/eb:From&gt;
            &lt;eb:To&gt;
                &lt;eb:PartyId eb:type="urn:x12.org:IO5:01"&gt;localhost/sabre&lt;/eb:PartyId&gt;
            &lt;/eb:To&gt;
            &lt;eb:CPAId&gt;3W2D&lt;/eb:CPAId&gt;
            &lt;eb:ConversationId&gt;testingId&lt;/eb:ConversationId&gt;
            &lt;eb:Service eb:type="sabreXML"&gt;"OTA_AirAvailService&lt;/eb:Service&gt;
            &lt;eb:Action&gt;ErrorRS&lt;/eb:Action&gt;
            &lt;eb:MessageData&gt;
                &lt;eb:MessageId&gt;506560ad-1ab6-4dfb-9b54-f26cef3e6658@20&lt;/eb:MessageId&gt;
                &lt;eb:Timestamp&gt;2016-01-24T09:28:54&lt;/eb:Timestamp&gt;
                &lt;eb:RefToMessageId&gt;1426190858&lt;/eb:RefToMessageId&gt;
            &lt;/eb:MessageData&gt;
        &lt;/eb:MessageHeader&gt;
        &lt;wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext"/&gt;
    &lt;/soap-env:Header&gt;
    &lt;soap-env:Body&gt;
        &lt;soap-env:Fault&gt;
            &lt;faultcode&gt;soap-env:Client.InvalidSecurityToken&lt;/faultcode&gt;
            &lt;faultstring&gt;Invalid or Expired binary security token: null&lt;/faultstring&gt;
            &lt;detail&gt;
                &lt;StackTrace&gt;com.sabre.universalservices.base.security.AuthenticationException: errors.session.USG_INVALID_SECURITY_TOKEN&lt;/StackTrace&gt;
            &lt;/detail&gt;
        &lt;/soap-env:Fault&gt;
    &lt;/soap-env:Body&gt;
&lt;/soap-env:Envelope&gt;
</code></pre>