title: Return object with Zend_Soap
body: <p>I would like to return an object using Zend_Soap. I also want the object given in the WSDL file. But I can't get both to work together. It's either one or the other.</p>
  
  <p><strong>1. WSDL working, but object not returning</strong></p>
  
  <p>If in the phpdoc of my function on the soap server script, I write</p>
  
  <pre><code> @return Application_Model_Soap_Test
  </code></pre>
  
  <p>I can see it in the WSDL file</p>
  
  <pre><code>&lt;message name="getPostcodeOut"&gt;
      &lt;part name="return" type="tns:Application_Model_Soap_Test"/&gt;
  &lt;/message&gt;
  </code></pre>
  
  <p>but when I run the script, it returns an empty class:</p>
  
  <pre><code>stdClass Object
  (
  )
  </code></pre>
  
  <p><strong>2. Get object, but wrong WSDL</strong></p>
  
  <p>If I change the server function's phpdoc info to </p>
  
  <pre><code>@return mixed Application_Model_Soap_Test
  </code></pre>
  
  <p>I get an object back with info:</p>
  
  <pre><code>stdClass Object
  (
      [name] =&gt; Fred
      [age] =&gt; 40
  )
  </code></pre>
  
  <p>but the WSDL file is wrong</p>
  
  <pre><code>&lt;message name="getPostcodeOut"&gt;
      &lt;part name="return" type="xsd:anyType"/&gt;
  &lt;/message&gt;
  </code></pre>
  
  <p>Any ideas? Thanks.</p>