我的amadeus ws旅行版本一直存在问题 每次我尝试为酒店预订时,我都会收到此错误
17 | session |目的地没有协议
这是我的代码 // curl url
$soapUrl = "http://amadeusws.tripxml.com/TripXML/wsTravelBuild_v03.asmx";
$xml_post_string = "<?xml version='1.0' encoding='utf-8'?>
<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>
<soap:Header>
<TripXML xmlns='http://amadeusws.tripxml.com/wsTravelBuild'>
<userName>string</userName>
<password>string</password>
<compressed>boolean</compressed>
</TripXML>
</soap:Header>
<soap:Body>
<wmTravelBuild xmlns='http://traveltalk.com/wsTravelBuild'>
<OTA_TravelItineraryRQ>
<POS>
<Source PseudoCityCode='JNBZA21ZZ' ISOCurrency='NGN'>
<RequestorID Type='21' ID='RubyTravel'/></Source>
<TPA_Extensions>
<Provider>
<Name>Amadeus</Name>
<System>Test</System>
<Userid>user</Userid>
<Password>user</Password>
</Provider>
</TPA_Extensions>
</POS>
<OTA_HotelResRQ><HotelReservations>
<HotelReservation RoomStayReservation='1'>
<RoomStays>
<RoomStay>
<RoomRates>
<RoomRate BookingCode='Q4WTPQJ' NumberOfUnits='1' RatePlanCode='PRO'>
</RoomRate>
</RoomRates>
<GuestCounts>
<GuestCount AgeQualifyingCode='ADT' Age='0' Count='1' />
</GuestCounts>
<TimeSpan Start='2017-08-20' Duration='' End='2017-08-23' >
</TimeSpan>
<Guarantee GuaranteeType='GuaranteeRequired'>
<GuaranteesAccepted>
<GuaranteeAccepted>
<PaymentCard CardType='Credit' CardCode='VI' CardNumber='4444333322221111' ExpireDate='0520'>
<CardHolderName>user User</CardHolderName>
<Address FormattedInd='false' Type='Home'>
<StreetNmbr>7300 NORTH KENDALL DRIVE</StreetNmbr>
<CityName>MIAMI</CityName>
<PostalCode>33156</PostalCode>
<StateProv>FL</StateProv>
<CountryName>USA</CountryName>
</Address>
</PaymentCard>
</GuaranteeAccepted>
</GuaranteesAccepted>
</Guarantee>
<DepositPayments> <RequiredPayment>
<AcceptedPayments>
<AcceptedPayment>
<PaymentCard CardType='Credit' CardCode='VI' CardNumber='4444333322221111' ExpireDate='0520'> <CardHolderName>user User</CardHolderName>
<Address FormattedInd='false' Type='Home'>
<StreetNmbr>7300 NORTH KENDALL DRIVE</StreetNmbr>
<CityName>MIAMI</CityName>
<PostalCode>33156</PostalCode>
<StateProv>FL</StateProv>
<CountryName>USA</CountryName>
</Address>
</PaymentCard>
</AcceptedPayment>
</AcceptedPayments>
</RequiredPayment>
</DepositPayments>
<BasicPropertyInfo ChainCode='HS' HotelCode='ATK' HotelCityCode='BKK' HotelCodeContext='1A' />
<ResGuestRPHs>
<ResGuestRPH RPH=''/>
</ResGuestRPHs>
</RoomStay>
</RoomStays>
</HotelReservation>
</HotelReservations></OTA_HotelResRQ><TPA_Extensions><PNRData>
<Traveler>
<PersonName>
<NamePrefix>MR</NamePrefix>
<GivenName>user</GivenName>
<Surname>user</Surname>
<NameTitle>Mr.</NameTitle>
</PersonName>
<TravelerRefNumber RPH='1'/>
</Traveler>
<Telephone PhoneLocationType='Home' CountryAccessCode='1' FormattedInd='0' AreaCityCode='MIAMI' PhoneNumber='8789878954'/>
<Email>email@gmail.com</Email>
<Ticketing><TicketAdvisory>OK</TicketAdvisory></Ticketing>
</PNRData></TPA_Extensions>
</OTA_TravelItineraryRQ>
</wmTravelBuild>
</soap:Body>
</soap:Envelope>";
/// header for the curl function
$headers = array(
"POST /TripXML/wsTravelBuild_v03.asmx HTTP/1.1",
"Host: amadeusws.tripxml.com",
"Content-Type: text/xml; charset=utf-8",
"SOAPAction: "."http://traveltalk.com/wsTravelBuild/wmTravelBuild",
"POST /TripXML/wsLowFarePlus.asmx HTTP/1.1",
"Content-Length: ".strlen($xml_post_string)
);
$url = $soapUrl; // curl url
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_post_string);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$reply = curl_exec($ch);
curl_close($ch);
有任何人遇到这个问题并且能够修复它,我使用相同的网址进行空中旅行建设并且效果很好但是当我发送请求为酒店创建预订时,它会一直返回错误。
答案 0 :(得分:1)
该错误消息表示您的Web服务访问权限未设置为使用该服务。您需要新的/更新的WSDL,或者在Amadeus上没有正确配置某些内容以供您使用该请求