title: PHP SOAP request
body: <p>I am working on an API Script for a client, and one of the services they need the request made to wants the content length. As far as I was aware, PHP cannot send the Content-Length in the header. I could be wrong but, without it, I keep getting <code>Premature end of data in tag html line 3 [string:Exception:private] =&gt; [code:protected] =&gt; 0 [file:protected] =&gt;</code></p>
  
  <p>The code looks as follows:</p>
  
  <pre><code>&lt;?
  try
  {
      $soap_url = 'http://admin.stock.imdfulfilment.com/api/service.asmx';
      $client = new SoapClient($soap_url);
  
      $header = new SoapHeader(
  
          'http://admin.stock.imdfulfilment.com/api/service/',
          'GetCouriers',
          array(
              'Content-Length' =&gt; '255'
          )
      );
      $client-&gt;__setSoapHeaders($header);
      var_dump($client-&gt;__getFunctions());
  }
  catch (Exception $e)
  {
     print_r($e);
  }
  </code></pre>