title: How to display the soap xml message before it's send using laravel-soap
body: <p>I managed to use <a href="https://github.com/artisaninweb/laravel-soap" rel="nofollow">laravel-soap</a> to send and receive requests, but for debugging purposes I want to print/echo the exact xml being send and received. </p>
  
  <p>I tried to use </p>
  
  <pre><code>-&gt;trace(true);
  </code></pre>
  
  <p>but that doesn't seem to help.</p>
  
  <p>So how do I print out the actual soap xml message being send and received</p>
  
  <p><strong>Update: This is my code</strong></p>
  
  <pre><code>&lt;?php
  namespace App\Http\Controllers;
  use Artisaninweb\SoapWrapper\Facades\SoapWrapper;
  class IsController extends Controller {
  public function demo()
  {
  // Add a new service to the wrapper
  SoapWrapper::add(function ($service) {
     $service
     -&gt;name('Test')
     -&gt;wsdl('http://link.to.provider/program.asmx?wsdl')
     -&gt;trace(true);
   });
  $data = [
       'UserName' =&gt; 'XXXXXXX',
       'Password'   =&gt; 'XXXXXXX',
      ];
  // Using the added service
  SoapWrapper::service('Test', function ($service) use ($data) {
  //var_dump($service-&gt;getFunctions());
  
  var_dump($service-&gt;getLastRequest());
  
  //dd($service-&gt;call('Login', [$data]));
  
  //dd($service-&gt;getLastResponse());
  
  });
  }
  }
  </code></pre>
  
  <p>I already tried replacing</p>
  
  <pre><code>echo htmlentities($service-&gt;getLastResponse());
  </code></pre>
  
  <p>with</p>
  
  <pre><code>dd($service-&gt;getLastResponse());
  </code></pre>
  
  <p>and </p>
  
  <pre><code>var_dump($service-&gt;getLastResponse());
  </code></pre>
  
  <p>The result is the; same the text "NULL"</p>