2015-10-13 76 views
0

我正在使用Saber GDS API。 GDS上的每個請求都需要Session,以便我開發了該會話,但是當我調用Bargain Finder Max Alternate Date API時,則出現以下錯誤。我被困在這件事上,一切都在我的腦海中。請幫助我,我非常感謝你們。cvc-elt.1.a:找不到元素'OTA_AirLowFareSearchRQ'的聲明

以下是要求:

<?xml version="1.0" encoding="UTF-8" ?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.somesite.org/schemas Schema.xsd"> 
    <SOAP-ENV:Header> 
     <m:MessageHeader xmlns:m="http://www.ebxml.org/namespaces/messageHeader"> 
      <m:From> 
       <m:PartyId type="urn:x12.org:IO5:01">webservices.sabre.com</m:PartyId> 
      </m:From> 
      <m:To> 
       <m:PartyId type="urn:x12.org:IO5:01">SWSSession</m:PartyId> 
      </m:To> 
      <m:CPAId>X2TH</m:CPAId> 
      <m:ConversationId>MyConversationID</m:ConversationId> 
      <m:Service m:type="sabreXML" /> 
      <m:Action>BargainFinderMax_ADRQ</m:Action> 
      <m:MessageData> 
       <m:MessageId>[email protected]</m:MessageId> 
       <m:Timestamp>2015-10-13T12:18:05</m:Timestamp> 
       <m:TimeToLive>2015-10-14T12:18:05</m:TimeToLive> 
      </m:MessageData> 
     </m:MessageHeader> 
     <wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext"> 
      <wsse:BinarySecurityToken EncodingType="wsse:Base64Binary" valueType="String">Token Here</wsse:BinarySecurityToken> 
     </wsse:Security> 
    </SOAP-ENV:Header> 
    <SOAP-ENV:Body> 
     <OTA_AirLowFareSearchRQ Version="1.9.0" ResponseType="OTA" ResponseVersion="1.9.0"> 
      <POS> 
       <Source PseudoCityCode="XXXX"> 
        <RequestorID ID="1" Type="1"> 
         <CompanyName Code="TN">TN</CompanyName> 
        </RequestorID> 
       </Source> 
      </POS> 
      <OriginDestinationInformation> 
       <DepartureDateTime>2015-10-25T20:06:25</DepartureDateTime> 
       <OriginLocation LocationCode="LHE" /> 
       <DestinationLocation LocationCode="LHR" /> 
       <TPA_Extensions> 
        <ConnectionTime Max="0" /> 
       </TPA_Extensions> 
      </OriginDestinationInformation> 
      <OriginDestinationInformation> 
       <DepartureDateTime>2015-10-25T20:06:25</DepartureDateTime> 
       <OriginLocation LocationCode="LHR" /> 
       <DestinationLocation LocationCode="LHE" /> 
       <TPA_Extensions> 
        <ConnectionTime Max="0" /> 
       </TPA_Extensions> 
      </OriginDestinationInformation> 
      <TravelPreferences ValidInterlineTicket="true"> 
       <TPA_Extensions> 
        <InterlineIndicator Ind="true" /> 
       </TPA_Extensions> 
      </TravelPreferences> 
      <TravelerInfoSummary> 
       <AirTravelerAvail> 
        <PassengerTypeQuantity Code="ADT" Quantity="1" /></AirTravelerAvail> 
       <PriceRequestInformation CurrencyCode="PKR"> 
        <TPA_Extensions> 
         <Priority> 
          <Price Priority="1" /> 
          <DirectFlights Priority="2" /> 
          <Time Priority="3" /> 
          <Vendor Priority="4" /> 
         </Priority> 
        </TPA_Extensions> 
       </PriceRequestInformation> 
      </TravelerInfoSummary> 
      <TPA_Extensions> 
       <IntelliSellTransaction> 
        <RequestType Name="AD3" /> 
       </IntelliSellTransaction> 
      </TPA_Extensions> 
     </OTA_AirLowFareSearchRQ> 
    </SOAP-ENV:Body> </SOAP-ENV:Envelope> 

這裏是我從API得到響應。請幫助我在哪裏我錯了。我正在使用帶有SOAP的PHP。

<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="1" eb:version="2.0"> 
      <eb:From> 
       <eb:PartyId>SWSSession</eb:PartyId> 
      </eb:From> 
      <eb:To> 
       <eb:PartyId>webservices.sabre.com</eb:PartyId> 
      </eb:To> 
      <eb:CPAId>X2TH</eb:CPAId> 
      <eb:ConversationId>MyConversationID</eb:ConversationId> 
      <eb:Service/> 
      <eb:Action>BargainFinderMax_ADRS</eb:Action> 
      <eb:MessageData> 
       <eb:MessageId>mid:[email protected]com</eb:MessageId> 
       <eb:Timestamp>2015-10-13T18:17:54Z</eb:Timestamp> 
      </eb:MessageData> 
      <eb:RefToMessageId>[email protected]</eb:RefToMessageId> 
     </eb:MessageHeader> 
    </SOAP-ENV:Header> 
    <SOAP-ENV:Body> 
     <OTA_AirLowFareSearchRS Version="1.9.0" xmlns="http://www.opentravel.org/OTA/2003/05" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
      <Errors> 
       <Error Type="SERVER" Code="ttfhli700" ShortText="80">TOMCAT</Error> 
       <Error Type="ERR" Code="INVALIDREQ" ShortText="Schema Validation Failed">cvc-elt.1.a: Cannot find the declaration of element 'OTA_AirLowFareSearchRQ'.</Error> 
      </Errors> 
     </OTA_AirLowFareSearchRS> 
    </SOAP-ENV:Body> 
</SOAP-ENV:Envelope> 

它給我架構驗證錯誤,我不是很熟悉XML/XSI。在此先感謝

+0

我有一個工作要求,它幾乎完全像你的。目前我沒有訪問WSDL的權限,但是您是否嘗試在操作中使用'BargainFinderMaxRQ'而不是'BargainFinderMax_ADRS'? –

回答

1

看起來好像你缺少這部分。

xmlns="http://www.opentravel.org/OTA/2003/05" 
在標籤

<OTA_AirLowFareSearchRQ xmlns="http://www.opentravel.org/OTA/2003/05" Version="1.9.0" ResponseType="OTA" ResponseVersion="1.9.0"> 

希望這將解決您的問題。

謝謝。

相關問題