2016-11-08 90 views
0

我使用BinarySecurityToken用于EnhancedAirBookRQ,但我收到USG_AUTHORIZATION_FAILED。我为BargainFinderMaxRQ使用了相同的标记,并且它工作正常。我是否应该获得另一组测试凭证,以便提供here的序列?EnhancedAirBookRQ上的验证错误

请求:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
       xmlns:sec="http://schemas.xmlsoap.org/ws/2002/12/secext" 
       xmlns:mes="http://www.ebxml.org/namespaces/messageHeader" 
       xmlns:ns="http://www.opentravel.org/OTA/2003/05"> 
<soapenv:Header> 
    <sec:Security> 
     <sec:BinarySecurityToken>--Token--</sec:BinarySecurityToken> 
    </sec:Security> 
    <mes:MessageHeader> 
     <mes:From> 
      <mes:PartyId type="urn:x12.org:IO5:01">from</mes:PartyId> 
     </mes:From> 
     <mes:To> 
      <mes:PartyId type="urn:x12.org:IO5:01">ws</mes:PartyId> 
     </mes:To> 
     <mes:CPAId>--CPAId--</mes:CPAId> 
     <mes:ConversationId>[email protected]</mes:ConversationId> 
     <mes:Service mes:type="sabreXML">sabreXML</mes:Service> 
     <mes:Action>EnhancedAirBookRQ</mes:Action> 
     <mes:MessageData> 
      <mes:MessageId>00000</mes:MessageId> 
      <mes:Timestamp>233</mes:Timestamp> 
     </mes:MessageData> 
     <mes:Description xml:lang="en-US">Testing</mes:Description> 
    </mes:MessageHeader> 
</soapenv:Header> 
<soapenv:Body> 
    <EnhancedAirBookRQ version="3.7.0" HaltOnError="true"> 
     <OTA_AirBookRQ> 
      <OriginDestinationInformation> 
       <FlightSegment DepartureDateTime="2016-11-15T10:05:00" FlightNumber="241" NumberInParty="2" 
           ResBookDesigCode="F" Status="NN"> 
        <DestinationLocation LocationCode="ATL"/> 
        <MarketingAirline Code="US" FlightNumber="241"/> 
        <OriginLocation LocationCode="LAS"/> 
       </FlightSegment> 
      </OriginDestinationInformation> 
     </OTA_AirBookRQ> 
    </EnhancedAirBookRQ> 
</soapenv:Body> 

响应:

<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"> 
<soap-env:Header> 
    <eb:MessageHeader eb:version="1.0" soap-env:mustUnderstand="1" 
         xmlns:eb="http://www.ebxml.org/namespaces/messageHeader"> 
     <eb:From> 
      <eb:PartyId eb:type="URI">ws</eb:PartyId> 
     </eb:From> 
     <eb:To> 
      <eb:PartyId eb:type="URI">from</eb:PartyId> 
     </eb:To> 
     <eb:CPAId>--CPAId--</eb:CPAId> 
     <eb:ConversationId>[email protected]</eb:ConversationId> 
     <eb:Service eb:type="sabreXML">sabreXML</eb:Service> 
     <eb:Action>ErrorRS</eb:Action> 
     <eb:MessageData> 
      <eb:MessageId>2308814425665870610</eb:MessageId> 
      <eb:Timestamp>2016-11-08T11:49:26</eb:Timestamp> 
      <eb:RefToMessageId>00000</eb:RefToMessageId> 
     </eb:MessageData> 
    </eb:MessageHeader> 
    <wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext"> 
     <wsse:BinarySecurityToken valueType="String" EncodingType="wsse:Base64Binary">--Token--</wsse:BinarySecurityToken> 
    </wsse:Security> 
</soap-env:Header> 
<soap-env:Body> 
    <soap-env:Fault> 
     <faultcode>soap-env:Client.AuthorizationFailed</faultcode> 
     <faultstring>Authorization failed</faultstring> 
     <detail> 
      <StackTrace>com.sabre.universalservices.base.security.AuthorizationException: 
       errors.authorization.USG_AUTHORIZATION_FAILED 
      </StackTrace> 
     </detail> 
    </soap-env:Fault> 
</soap-env:Body> 

回答

1

你有一个API协议?看起来你的凭证没有适当的授权来使用该服务。

如果您有合同,我建议您联系帮助台,以便他们可以修改您的凭证。

+0

我联系Saber支持以获取测试凭证以访问用于应用程序开发的SOAP API。我收到证书并生成令牌并使用它,但它适用于某些API调用(如BargainFinderMaxRQ),并且不适用于某些(如EnhancedAirBookRQ)。好吧,我会联系Saber支持。 – Melon

+0

你正在创建调用CreateToken或CreateSession? – jmacagno

+0

使用CreateToken。但我也尝试过使用CreateSession,但没有奏效。 – Melon