SOAP, WSDL, Lit+Documents and multi-node lists
| From: | Paul Wright | Date: | Tue, 15 Mar 2005 16:50:26 +0000 |
| Subject: | SOAP, WSDL, Lit+Documents and multi-node lists | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-18072@lists.php.net to get a copy of this message | ||
Hi all,
I'm currently in the middle of integrating a .NET SOAP service into a
client's site. The service has WSDL files for all the services so I
create a soap client thus:
$wsdl = new SOAP_WSDL('http://www.example.com/Service.asmx?wsdl')
$client = $wsdl->getProxy();
I have used the resulting $client without problem, except now. I need
to pass parameters to a method in some way so that the client will
create the following snippet of xml in the soap request:
<Requests>
<RoomRequest>
<RoomID>1</RoomID>
<NumRooms>3</NumRooms>
</RoomRequest>
<RoomRequest>
<RoomID>2</RoomID>
<NumRooms>1</NumRooms>
</RoomRequest>
</Requests>
I can get one of the room requests from this structure:
$requests['RoomRequest'] = array("RoomID" => 1, "NumRooms" =>
3);
But I cannot get more than one to appear, $requests[0]['RoomRequest']
and $request[1]['RoomRequest'] result in extra <item> tags round each
<RoomRequest> tag.
If it helps at all the WSDL file is located at:
http://tkl.mars-on-the-net.com/marsserver/Hotels.asmx?wsdl
and I'm trying to call the BookRooms method which takes an array of RoomRequest.
Is there another approach I should be using? I had thought about
trying DOM to build the xml and I've also tried passing in a string
containing all the xml as the only parameter but this just resulted in
< and > littered throughout.
Cheers,
Paul.