Forum Moderators: coopster

Message Too Old, No Replies

How to obtain my SOAP call request in XML format?

         

guarriman

5:11 pm on Mar 12, 2008 (gmt 0)

10+ Year Member



Hi.

Using PHP5 + SOAP, I'd like to obtain my SOAP call request in XML format. For instance:

--------
POST /UsersData.asmx HTTP/1.1
Host: lab.webservice.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://lab.webservice.com/isValidUser"

<?xml version="1.0" encoding="utf-8"?>
<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.webservice.com/">
<UserId>int</UserId>
<lastName>string</lastName>
</isValidUser>
</soap:Body>
</soap:Envelope>
-----------

I use this piece of PHP code:
---------
$client = new SoapClient($wsdl, array('trace'=>true, 'exceptions'=>true));
$response = $client->__call('isValidUser', $options);
----------

What might I include in my PHP code to get this request? Thank you very much.

coopster

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

WebmasterWorld Administrator 10+ Year Member



The return value would be in your
$response
variable. The
__call
method is deprecated though, you should be using __soapCall [php.net]

Return Values

SOAP functions may return one, or multiple values. If only one value is returned by the SOAP function, the return value of __soapCall will be a simple value (e.g. an integer, a string, etc). If multiple values are returned, __soapCall will return an associative array of named output parameters.