title: How to dump SoapClient request for debug?
body: <p>I need to debug some code which uses soap client. I found getLast* methods in php.net, but when I try to get last request for debug it returns NULL</p>
  <pre><code>&lt;?php
  
      $client = new SoapClient(&quot;http://www.webservicex.net/ConverPower.asmx?WSDL&quot;);
      
      $response = $client-&gt;ChangePowerUnit(array(
          &quot;PowerValue&quot; =&gt; 100,
          &quot;fromPowerUnit&quot; =&gt; &quot;horsepower&quot;,
          &quot;toPowerUnit&quot; =&gt; &quot;megawatts&quot;
      ));
      
      
      echo &quot;====== REQUEST HEADERS =====&quot; . PHP_EOL;
      var_dump($client-&gt;__getLastRequestHeaders());
      echo &quot;========= REQUEST ==========&quot; . PHP_EOL;
      var_dump($client-&gt;__getLastRequest());
      echo &quot;========= RESPONSE =========&quot; . PHP_EOL;
      var_dump($response);
  
  ?&gt;
  </code></pre>
  <p>The result of code execution:</p>
  <pre><code>$php soap_test.php 
  
  ====== REQUEST HEADERS =====
  NULL
  ========= REQUEST ==========
  NULL
  ========= RESPONSE =========
  object(stdClass)#2 (1) {
    [&quot;ChangePowerUnitResult&quot;]=&gt;
    float(0.0746)
  }
  </code></pre>
  <p>How to get the content of body and headers of the last SoapClient request?</p>