我使用的是Sabre GDS API。 GDS上的每个请求都需要Session,以便我开发了会话,但是当我调用Bargain Finder Max Alternate Date API时,我收到以下错误。我很难坚持下去,事情正在发生在我脑海中。请帮助我,我非常感谢你们。
以下是请求:
<?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>2afbf3e7-8de6-4397-9fcb-8c9b01624131@61</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:20151013-181754456-4812.BargainFinderMax_ADRS@webservices.sabre.com</eb:MessageId>
<eb:Timestamp>2015-10-13T18:17:54Z</eb:Timestamp>
</eb:MessageData>
<eb:RefToMessageId>2afbf3e7-8de6-4397-9fcb-8c9b01624131@61</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 :(得分: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">
希望这能解决您的问题。
感谢。