我正在开发一个航班预订 API。我通过以下方式将数据发送到服务器:
$location_URL = "http://59.162.33.102/ArzooWS/services/DOMFlightBooking?wsdl";
$action_URL ="http://booking.flight.arzoo.com";
$client = new SoapClient('http://59.162.33.102/ArzooWS/services/DOMFlightBooking?wsdl', array(
'soap_version' => SOAP_1_1,
'location' => $location_URL,
'uri' => $action_URL,
'style' => SOAP_RPC,
'use' => SOAP_ENCODED,
'trace' => 1,
));
我还在编辑解析的 XML 格式化请求下面提到了 XML SOAP 正文:
<?xml version="1.0" encoding="utf-8"?>
<Bookingrequest>
<onwardFlights>
<OriginDestinationOption>
<FareDetails>
<ChargeableFares>
<ActualBaseFare>5060</ActualBaseFare>
<Tax>4380</Tax>
<STax>32</STax>
<SCharge>0</SCharge>
<TDiscount>0</TDiscount>
<TPartnerCommission>0</TPartnerCommission>
</ChargeableFares>
<NonchargeableFares>
<TCharge>0</TCharge>
<TMarkup>300</TMarkup>
<TSdiscount>0</TSdiscount>
</NonchargeableFares>
</FareDetails>
<FlightSegments>
<FlightSegment>
<AirEquipType>321</AirEquipType>
<ArrivalAirportCode>DEL</ArrivalAirportCode>
<ArrivalDateTime>2013-10-20T08:00:00</ArrivalDateTime>
<DepartureAirportCode>BOM</DepartureAirportCode>
<DepartureDateTime>2013-10-20T06:00:00</DepartureDateTime>
<FlightNumber>6019</FlightNumber>
<OperatingAirlineCode>AI</OperatingAirlineCode>
<OperatingAirlineFlightNumber>6019</OperatingAirlineFlightNumber>
<RPH>
</RPH>
<StopQuantity>0</StopQuantity>
<airLineName>Air India</airLineName>
<airportTax>4380</airportTax>
<imageFileName>http://live.arzoo.com/FlightWS/image/AirIndia.gif</imageFileName>
<viaFlight>
</viaFlight>
<BookingClass>
<Availability>4</Availability>
<ResBookDesigCode>U</ResBookDesigCode>
</BookingClass>
<BookingClassFare>
<adultFare>5060</adultFare>
<bookingclass>U</bookingclass>
<classType>Economy</classType>
<farebasiscode>fjyS3YyUlEusLfJ4bwgPvQ==</farebasiscode>
<Rule>This fare is Refundable <br> Baggage : 25K<br>Booking Class : U|Re-Schedule Charges: Rs. 750 per sector + Fare difference (If any) +admin fee 500 + Service Fee of Rs. 250
Sector .|Cancellation Charges : Basic fare +Airline administration fee 500 + Service Charges 250 Per Passenger Per Sector .
|</Rule>
<adultCommission>0</adultCommission>
<childCommission>0</childCommission>
<commissionOnTCharge>0</commissionOnTCharge>
</BookingClassFare>
<Discount>0</Discount>
<airportTaxChild>0</airportTaxChild>
<airportTaxInfant>0</airportTaxInfant>
<adultTaxBreakup>2950,147,1283</adultTaxBreakup>
<childTaxBreakup>0,0,0</childTaxBreakup>
<infantTaxBreakup>0,0,0</infantTaxBreakup>
<octax>0</octax>
</FlightSegment>
</FlightSegments>
<id>arzoo11</id>
<key>wtZcSVMY/gphWFSOTFWg8nkII1434EZIGjnpJNQzayEK8sDjVS91GicTJzH+TWN+pNURIyTJYKOW
O8yH8+0tzpA4t8aEEvzaOE6ZnTtBotFDwLtSiN0xXiTOGgS0siJI1l7d9ata/3rxTgfh9d8ZSmFY
VI5MVaDyd5WrIWHlQL5zqWDbQb1E1IoDSY1wep73c6lg20G9RNQQnpVlWM7U0ZY7zIfz7S3O4J6m
G25LJItzqWDbQb1E1IoDSY1wep73c6lg20G9RNSKA0mNcHqe93OpYNtBvUTUpvdITjbFOR52+H1V
tJqs5kJfo6Sh44vDThgZv6ARhgviIKxphH+kbb9fDhZYRaCPm3lupCgitSmWO8yH8+0tzolfF9kG
WM+AaZ58PxEZgqCbbbGbXj1Z0D7dHS59eVX1JxMnMf5NY37ZbJ5llqmBpycTJzH+TWN+2WyeZZap
gacnEycx/k1jftlsnmWWqYGnJxMnMf5NY37ZbJ5llqmBpycTJzH+TWN+2WyeZZapgacnEycx/k1j
ftlsnmWWqYGnJxMnMf5NY36po4tljIBmEJgePqv2qP9fd/Usd8Uuz7FDwLtSiN0xXvtUK9az69O/
JxMnMf5NY37yK2PFSCI6AM2hLlYrFkYJQ8C7UojdMV7NoS5WKxZGCcr5VjCR04wgRviI6n9DzL3N
oS5WKxZGCUPAu1KI3TFezaEuVisWRglDwLtSiN0xXv4Xbn4sigRMv18OFlhFoI/cKcKe7FftvScT
JzH+TWN+2WyeZZapgacnEycx/k1jftlsnmWWqYGnJxMnMf5NY377Oxb/b44TR5Y7zIfz7S3O16CE
sDaAROm13h/OHWeGHw==</key>
</OriginDestinationOption>
</onwardFlights>
<returnFlights>
</returnFlights>
<personName>
<CustomerInfo>
<givenName>Rajnish</givenName>
<surName>Dubey</surName>
<nameReference>Mr.</nameReference>
<psgrtype>adt</psgrtype>
</CustomerInfo>
</personName>
<telePhone>
<phoneNumber>9595959595</phoneNumber>
</telePhone>
<email>
<emailAddress>rajnishdubey1988@gmail.com</emailAddress>
</email>
<creditcardno>5266474530046446</creditcardno>
<Clientid>7232326</Clientid>
<Clientpassword>*AB424E52FBBHDSFS74DFFSA7B747A9BAF61F8E</Clientpassword>
<partnerRefId>100200</partnerRefId>
<Clienttype>ArzooFWS1.1</Clienttype>
<AdultPax>1</AdultPax>
<ChildPax>0</ChildPax>
<InfantPax>0</InfantPax>
</Bookingrequest>
try
{
//$result = $client->getAvailability($dom->saveXML($request));
$result = $client->getBookingDetails($dom->saveXML($request));
$response= htmlentities($result);
echo "<h1> Client Response: </h1><pre>".htmlspecialchars($result, ENT_QUOTES)."</pre>";
}
catch(Exception $e){
echo "<h2>Exception Error!</h2>";
echo $e->getMessage();
}
现在,当数据被发送到服务器时,我得到一个异常“错误版本”。我检查了服务器端,这个特定客户端的日志根本没有被命中。表示服务器没有收到请求。相同的 WSDL 请求格式由航班的 AVAILABILITY API 创建。我正在通过 AVAILABILITY API 获取可用的航班列表。我将上述代码转换为 XML,API 文档的格式与我发送请求的格式相同。我在互联网上查了一下,但没有找到相同的解决方案。有人说我使用的 SOAP 版本不同,但事实并非如此。因为航班和酒店可用性 API 具有相同的请求和从服务器接收数据的方法。请帮我。我坚持这一点。您的帮助将不胜感激。