Answer the question
In order to leave comments, you need to log in
How to send a SOAP request via PHP?
You need to send such a request through PHP and get a response. How to do it? There is a soap client on the server.
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://pegast.com/pegasys/api/IPackageSearchService/GetOptions</Action>
<h:ApiUserKey xmlns:h="http://pegast.com/pegasys/api">XXX</h:ApiUserKey>
<h:PreferredLanguageCode i:nil="true" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:h="http://pegast.com/pegasys/api" />
</s:Header>
<s:Body>
<PackageSearchOptionsRequest xmlns="http://pegast.com/pegasys/api">
<Parameters xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<DepartureLocationId i:nil="true" />
<DestinationCountryId i:nil="true" />
<Groups>Directions</Groups>
<HotelIds xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
<MarketIds xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
<PackageId i:nil="true" />
<PackageTypeIds xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
<ReturnHotelOptionsWithAttributes>false</ReturnHotelOptionsWithAttributes>
<ReturnHotelOptionsWithMeals>false</ReturnHotelOptionsWithMeals>
<ReturnLocationId i:nil="true" />
<ReturnPastDepartureDates>false</ReturnPastDepartureDates>
</Parameters>
</PackageSearchOptionsRequest>
</s:Body>
</s:Envelope>
$client = new SoapClient("https://api-ext-test.pegasys.pegast.com/PackageSearch.svc?singleWsdl");
$header = new SoapHeader('http://pegast.com/pegasys/api/IPackageSearchService/GetOptions', 'ApiKeyXX','RU');
$client->__setSoapHeaders($header);
print($client->GetOptions(PackageSearchOptionsRequest,array("Groups"=>"Directions")));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question