title: WSDL and SOAP: Return object with methods
body: <p>Is there a way to return in soap an object with his methods? If i return xsd:struct in WSDL i only get the properties of the object but i can't use any of the methods.</p>
  
  <p>For example</p>
  
  <pre><code>class person
  {
    var $name = "My name";
    public function getName()
    {
        return $this-&gt;name;
    }
  }
  </code></pre>
  
  <p>So after fetching the object:</p>
  
  <pre><code>$client = new SoapClient();
  $person = $client-&gt;getPerson();
  echo $person-&gt;getName(); // Return "My Name";
  </code></pre>
  
  <p>Thanks.</p>