我是PHP的新手。我有一个busBooking soap api,我想将它集成到我的php应用程序中。
我有以下详情
登录网址:http://api.tektravels.com/BusBookingAPI/Service.asmx
和登录名和密码
我有六个sampleXML集,如下所示:
BusBookRequest, BusBookResponse, BusSearchRequest, BusSearchResponse, BusSeatDetailRequest, BusSeatDetailResponse
以下是BusBookRequest XML
<?xml version="1.0" encoding="utf-16"?> <WSBookRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <ProductTypeId xmlns="http://192.168.0.131/TT/BusBookingAPI">0</ProductTypeId> <ProductId xmlns="http://192.168.0.131/TT/BusBookingAPI">0</ProductId> <BookingMode xmlns="http://192.168.0.131/TT/BusBookingAPI">Auto</BookingMode> <ProductType xmlns="http://192.168.0.131/TT/BusBookingAPI">Bus</ProductType> <BusId xmlns="http://192.168.0.131/TT/BusBookingAPI">0</BusId> <SourceId xmlns="http://192.168.0.131/TT/BusBookingAPI">1492</SourceId> <DestinationId xmlns="http://192.168.0.131/TT/BusBookingAPI">1135</DestinationId> <SourceName xmlns="http://192.168.0.131/TT/BusBookingAPI">Delhi</SourceName> <DestinationName xmlns="http://192.168.0.131/TT/BusBookingAPI">Manali</DestinationName> <DateOfJourney xmlns="http://192.168.0.131/TT/BusBookingAPI">2014-09-26T00:00:00</DateOfJourney> <BusSource xmlns="http://192.168.0.131/TT/BusBookingAPI">RedBus</BusSource> <IsDomestic xmlns="http://192.168.0.131/TT/BusBookingAPI">true</IsDomestic> <RouteId xmlns="http://192.168.0.131/TT/BusBookingAPI">201653313640000758</RouteId> <BusType xmlns="http://192.168.0.131/TT/BusBookingAPI">Volvo A/C Seater Semi Sleeper (2+2)</BusType> <TravelName xmlns="http://192.168.0.131/TT/BusBookingAPI">Royal Travels</TravelName> <NoOfSeats xmlns="http://192.168.0.131/TT/BusBookingAPI">1</NoOfSeats> <DepartureTime xmlns="http://192.168.0.131/TT/BusBookingAPI">2014-09-26T17:00:00</DepartureTime> <ArrivalTime xmlns="http://192.168.0.131/TT/BusBookingAPI">2014-09-27T07:00:00</ArrivalTime> <TotalFare xmlns="http://192.168.0.131/TT/BusBookingAPI">1450.00</TotalFare> <BoardingPointdetails xmlns="http://192.168.0.131/TT/BusBookingAPI"> <CityPointId>21533</CityPointId> <BusId>0</BusId> <CityPointName>Paharganj</CityPointName> <CityPointLocation>Paharganj</CityPointLocation> <CityPointLandmark>Opp Paharganj Police Station</CityPointLandmark> <CityPointAddress>Shop No. BG 16,Ground Floor,RG City Centre,Opp. Paharganj Police Station,Delhi</CityPointAddress> <CityPointContactNumber>011-43074720/9899199491/9953733177/9873787138</CityPointContactNumber> <CityPointTime>2014-09-26T17:00:00</CityPointTime> </BoardingPointdetails> <CancelPolicy xmlns="http://192.168.0.131/TT/BusBookingAPI"> <WSCancellationPolicies> <BusId>0</BusId> <TimeBeforeDept>0$15</TimeBeforeDept> <CancellationChargeType>Percentage</CancellationChargeType> <CancellationCharge>100</CancellationCharge> </WSCancellationPolicies> <WSCancellationPolicies> <BusId>0</BusId> <TimeBeforeDept>15$-1</TimeBeforeDept> <CancellationChargeType>Percentage</CancellationChargeType> <CancellationCharge>10</CancellationCharge> </WSCancellationPolicies> </CancelPolicy> <PaxDetail xmlns="http://192.168.0.131/TT/BusBookingAPI"> <BusId>0</BusId> <PaxId>0</PaxId> <Title>Mr.</Title> <LastName>kjhj</LastName> <FirstName>hkhjk</FirstName> <Age>21</Age> <PhoneNo>9876543211</PhoneNo> <EMail>sonam@travelboutiqueonline.com</EMail> <Gender>male</Gender> </PaxDetail> <SeatsDetail xmlns="http://192.168.0.131/TT/BusBookingAPI"> <WSBusSeatDetail> <SeatId>0</SeatId> <BusId>0</BusId> <SeatName>27</SeatName> <SeatType>sleeper</SeatType> <RowNo>003</RowNo> <ColumnNo>006</ColumnNo> <SeatStatus>1</SeatStatus> <SeatFare>725.00</SeatFare> <priceId>0</priceId> <Width>1</Width> <Height>1</Height> <IsLadies>false</IsLadies> <IsUpper>false</IsUpper> <Price> <TdsCommission>3.62</TdsCommission> <PriceId>0</PriceId> <PublishedFare>725.00</PublishedFare> <AgentCommission>36.25</AgentCommission> <SeviceTax>0.00</SeviceTax> <Tax>0</Tax> <Currency /> <RateOfExchange>1.0</RateOfExchange> <CurrencyCode>INR</CurrencyCode> <Discount>0</Discount> <TdsRate>0</TdsRate> </Price> </WSBusSeatDetail> <WSBusSeatDetail> <SeatId>0</SeatId> <BusId>0</BusId> <SeatName>28</SeatName> <SeatType>sleeper</SeatType> <RowNo>004</RowNo> <ColumnNo>006</ColumnNo> <SeatStatus>1</SeatStatus> <SeatFare>725.00</SeatFare> <priceId>0</priceId> <Width>1</Width> <Height>1</Height> <IsLadies>false</IsLadies> <IsUpper>false</IsUpper> <Price> <TdsCommission>3.62</TdsCommission> <PriceId>0</PriceId> <PublishedFare>725.00</PublishedFare> <AgentCommission>36.25</AgentCommission> <SeviceTax>0.00</SeviceTax> <Tax>0</Tax> <Currency /> <RateOfExchange>1.0</RateOfExchange> <CurrencyCode>INR</CurrencyCode> <Discount>0</Discount> <TdsRate>0</TdsRate> </Price> </WSBusSeatDetail> </SeatsDetail> <Currency xmlns="http://192.168.0.131/TT/BusBookingAPI">INR</Currency> <SessionId xmlns="http://192.168.0.131/TT/BusBookingAPI">57f27951-0018-411b-b0a1-d23cdb366c04</SessionId> </WSBookRequest>
请帮助我如何将其与此详细信息集成以及如何使用PHP访问响应。
答案 0 :(得分:0)
开始阅读SoapClient。
开始于:
$wsdl = 'http://api.tektravels.com/BusBookingAPI/Service.asmx?WSDL';
$client = new SoapClient($wsdl);
print_r($client->__getFunctions());