1

this is how my request needs to look in XML format:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:ns="http://www.juniper.es/webservice/2007/">
   <soap:Header/>
   <soap:Body>
      <ns:HotelList>
         <ns:HotelListRQ Version="1.1" Language="en">
            <Login Password="pass" Email="me@mydomain"/>
            <ns:HotelListRequest ZoneCode="12345">
         </ns:HotelListRQ>
      </ns:HotelList>
   </soap:Body>
</soap:Envelope>

Here is my attempt to pass the following array as the 2nd param in __soapCall(). Docs here: https://www.php.net/manual/en/soapclient.soapcall.php

$argument = ["body" => 
            ["HotelList" =>
                ["HotelListRQ" =>
                    ["Login" => ["password" => "pass", "email" => "me@mydomain"],
                    ["HotelListRequest" => ["ZoneCode" => $zoneCode]],
                ],
            ],
];

But the resulting request is a mess, see here:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://xml-uat.bookingengine.es/webservice/JP/WebServiceJP.asmx?WSDL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://xml.apache.org/xml-soap" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <SOAP-ENV:Body>
        <ns1:HotelList>
            <param0 xsi:type="ns2:Map">
                <item>
                    <key xsi:type="xsd:string">HotelList</key>
                    <value xsi:type="ns2:Map">
                        <item>
                            <key xsi:type="xsd:string">HotelListRQ</key>
                            <value xsi:type="ns2:Map">
                                <item>
                                    <key xsi:type="xsd:string">Login</key>
                                    <value xsi:type="ns2:Map">
                                        <item>
                                            <key xsi:type="xsd:string">email</key>
                                            <value xsi:type="xsd:string">me@mydomain</value>
                                        </item>
                                        <item>
                                            <key xsi:type="xsd:string">password</key>
                                            <value xsi:type="xsd:string">pass</value>
                                        </item>
                                    </value>
                                </item>
                            </value>
                        </item>
                        <item>
                            <key xsi:type="xsd:int">0</key>
                            <value xsi:type="ns2:Map">
                                <item>
                                    <key xsi:type="xsd:string">HotelListRequest</key>
                                    <value xsi:type="ns2:Map">
                                        <item>
                                            <key xsi:type="xsd:string">ZoneCode</key>
                                            <value xsi:type="xsd:int">12345</value>
                                        </item>
                                    </value>
                                </item>
                            </value>
                        </item>
                    </value>
                </item>
            </param0>
        </ns1:HotelList>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

what's the correct way to construct this request as an array?

4

0 回答 0