I
I
IdFox2015-02-04 12:50:06
PHP
IdFox, 2015-02-04 12:50:06

How to correctly form a SOAP request in PHP?

Good day everyone. I am addressing here with a question, maybe they will help here)
In general, the essence is this. We carry out integration with XML SOAP interfaces of various tour operators
I myself am weak in SOAP. I've done integration with 2 operators up to now.
By trial and error, something worked out
. But with Pegasus, somehow everything doesn't work out ( In general, you can help with the formation of an
XML request for a SOAP service at
the end)
Can you provide PHP code that performs this task?
Thanks everyone in advance for help

<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">XXXXXXXXX</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>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Max, 2015-02-04
@AloneCoder

like so ?

$client->PackageSearchOptionsRequest(array('Parameters' => array(...)));

I
Immortal_pony, 2015-02-05
@Immortal_pony

PHP has a library for working with SOAP. The principle of its operation is described, for example, here .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question