Forum Moderators: coopster

Message Too Old, No Replies

How to reproduce an XML Request via SOAP?

         

guarriman

12:37 pm on Mar 14, 2008 (gmt 0)

10+ Year Member



Hi.

I've got this SOAP request structure I must comply in my petition:


<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<isValidUser xmlns="http://lab.domain.com/">
<userId>int</userId>
<lastName>string</lastName>
</isValidUser>
</soap:Body>
</soap:Envelope>

and I wrote in my PHP code


$params = array('userId' => '5555', 'lastName' => 'Smith');
$response = $client->__soapCall("isValidUser", $params);

but I generate this request message:


<SOAP-ENV:Body>
<ns1:isValidUser/>
<param1>Smith</param1>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Which code must I write in PHP to reproduce the XML request I need?

Thank you very much.

coopster

9:56 pm on Mar 18, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



It looks like you are on the right track. You need to build your header(s) and then the request using the SOAP Functions [php.net]. There are examples on those pages to get you started.