How to obtain my SOAP call request in XML format?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
guarriman
Forum Commoner
Posts: 44
Joined: Thu Nov 03, 2005 4:11 am

How to obtain my SOAP call request in XML format?

Post by guarriman »

Hi.

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

Code: Select all

 
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:

Code: Select all

 
$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.
Post Reply