title: Inspect XML created by PHP SoapClient call before/without sending the request
body: <p>The question:
  Is there a way to view the XML that would be created with a PHP SoapClient function call BEFORE you actually send the request?</p>
  
  <p>background:</p>
  
  <p>I am new to WSDL communication, and I have a client who wants me to develop in PHP, a way to communicate with a WSDL service written in ASP.NET.  I have gotten pretty far, but am running into an issue when it comes to passing a complex type.  I have tried a couple of different things so far.</p>
  
  <p>1) Setting up a single array such as <code>$params-&gt;Person-&gt;name</code> <code>$params-&gt;Person-&gt;address</code></p>
  
  <p>2) Setting up a single array <code>$Person = array('name'=&gt;"joe",'address' = "123");</code></p>
  
  <p>then passing into the call as a param "Person" => $Person;
  and a few others.  But every time I get the error</p>
  
  <blockquote>
    <p>SoapException: Server was unable to
    process request ---> System.Exception:
    Person is Required. at service name.</p>
  </blockquote>
  
  <p>In order to further the troubleshooting, I would like to see the XML document that is being sent to see if it is creating a complex type in the way I am expecting it to.
  I am creating the service using <code>$client = new SoapClient('wsdldoc.asmx?WSDL');</code> calling it with <code>$client-&gt;CreateUser($params);</code> and then trying to see it using the function <code>$client-&gt;__getLastRequest();</code>  but it never makes it to the __getLastRequest because it hits a fatal error when calling CreateUser($params).  </p>
  
  <p>The question again:
  Is there any way to view the XML created by the CreateUser($params) call WITHOUT actually sending it and causing a fatal error</p>