как интегрировать soap xml api с веб-сервисом в php

0

Я новичок в PHP. У меня есть busbooking soap api, и я хочу интегрировать его в свое приложение php.

У меня есть следующие данные

URL входа: 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>[email protected]</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> <?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>[email protected]</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.

Теги:
soap
web-services

1 ответ

0
Лучший ответ

Начните читать SoapClient.

Начните с:

$wsdl = 'http://api.tektravels.com/BusBookingAPI/Service.asmx?WSDL';
$client = new SoapClient($wsdl);
print_r($client->__getFunctions());
  • 0
    ошибка его показа Неустранимая ошибка: класс 'SoapClient' не найден?
  • 0
    php.net/manual/en/soap.installation.php
Показать ещё 1 комментарий

Ещё вопросы

Сообщество Overcoder
Наверх
Меню