title: PHP SoapClient fails after one request
body: <p>I have a PHP script that uses SoapClient to access an API.  After connecting, if I just make one request, it works as expected but when I try to make a second request with the same SoapClient object, i get a <code>Bad Request</code> error.</p>
  
  <p>I believe the issue may have to do with my server configuration because the same PHP code works fine in another computer with an older version of PHP but on my test and production servers which have been updated to PHP 5.6 both experience this error.  </p>
  
  <p>Code:</p>
  
  <pre><code>    &lt;?php
  
  class ReportAPI
  {
    protected $reportDataObject = null;
  
    public function __construct($url = 'URL', $username = 'username', $password = 'pass') {
      $this-&gt;client = new SoapClient($url , array('login' =&gt; $username, 'password' =&gt; $password, 'keep_alive' =&gt; true));
    }
    public function getReportData($reportID) {
      return $this-&gt;getDataObject($reportID)-&gt;data;
    }
    public function getReportCount($reportID) {
      return $this-&gt;getDataObject($reportID)-&gt;result_count;
    }
    public function runReport($reportID) {
      $newID = $this-&gt;client-&gt;runReport($reportID);
      $counter = 0;
      while($this-&gt;client-&gt;checkReportRun($newID) != 'complete'){
        if($counter &gt; 2) {
          throw new Exception('Report Time Out');
        }
        sleep(5);
        $counter++;
      }
      $this-&gt;getDataObject($newID);
      return $newID;
    }
  
    public function functest() {
      $v0 = $this-&gt;getDataObject('id')-&gt;result_count;
      return $this-&gt;getDataObject('id')-&gt;data;
    }
  
    public function getLatestID($reportID) {
      $runlist = $this-&gt;client-&gt;getReportRunList($reportID);
      return $runlist[0][0];
    }
  
    public function getLatestReportData($reportID) {
      return $this-&gt;getReportData($this-&gt;getLatestID($reportID));
    }
  
    public function getTitles($reportID) {
      return $this-&gt;getDataObject($reportID)-&gt;columns;
    }
  
    public function getReportRunTime($reportID) {
      $runlist = $this-&gt;client-&gt;getReportRunList($reportID);
      return strtotime($runlist[0][2]);
    }
  
    public function getRawReport($reportID) {
      return $this-&gt;client-&gt;getReportDataObject($reportID);
    }
  
    protected function getDataObject($reportID) {
      if(!isset($this-&gt;reportDataObject) || $this-&gt;reportDataObject-&gt;report_run_id != $reportID) {
        $this-&gt;reportDataObject = $this-&gt;client-&gt;getReportDataObject($reportID);
      }
      return $this-&gt;reportDataObject;
    }
  }
  
  ?&gt;
  </code></pre>