title: SOAP-ERROR: Encoding: Object has no property
body: <p>I need to create a SOAP request which looks like this: </p>
  
  <pre><code>&lt;soapenv:Body&gt;
  &lt;getItemsForProject&gt;
     &lt;token&gt;
        &lt;user&gt;?&lt;/user&gt;
        &lt;password&gt;?&lt;/password&gt;
     &lt;/token&gt;
     &lt;projectId&gt;&lt;/projectId&gt;
     &lt;start&gt;0&lt;/start&gt;
     &lt;count&gt;0&lt;/count&gt;
  &lt;/getItemsForProject&gt; 
  &lt;/soapenv:Body&gt;
  </code></pre>
  
  <p>The operation expects this:</p>
  
  <pre><code>[209] =&gt; struct getItemsForProject {
   wsAuth token;
   long projectId;
   int start;
   int count;
  }
  </code></pre>
  
  <p>I have tried the following but keep hitting <code>PHP Fatal error:  SOAP-ERROR: Encoding: object has no 'start' property</code></p>
  
  <p>I know that the token object can be created like this, as I have used it for another operation:</p>
  
  <pre><code>$auth-&gt;token = new \stdClass;
  $auth-&gt;token-&gt;user = $username;
  $auth-&gt;token-&gt;password = $password;
  </code></pre>
  
  <p>However, doing something similar for the 'start' parameter is failing with the fatal error message. Here's part of the code:</p>
  
  <pre><code>$opts = new \StdClass;
  $opts-&gt;projectId = 123;
  $opts-&gt;start = 0;
  $opts-&gt;count = 0;
  
  $resp = $soap-&gt;getItemsForProject($auth, $opts);       
  
  echo $soap-&gt;__getLastRequest() ."\n";
  </code></pre>
  
  <p>I am unable to print the full soap request using <code>$soap-&gt;__getLastRequest()</code> because it is returning the fatal error before issuing the request. Similarly, I cannot use <code>var_dump()</code> on the <code>$resp</code> because it dies before executing that line. How can I tell what is actually being sent?! If I know that, then I can debug this more easily.</p>
  
  <p>Thanks,
  <strong>ns</strong></p>