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.
1. WSDL working, but object not returning
If in the phpdoc of my function on the soap server script, I write
@return Application_Model_Soap_Test
I can see it in the WSDL file
<message name="getPostcodeOut">
<part name="return" type="tns:Application_Model_Soap_Test"/>
</message>
but when I run the script, it returns an empty class:
stdClass Object
(
)
2. Get object, but wrong WSDL
If I change the server function's phpdoc info to
@return mixed Application_Model_Soap_Test
I get an object back with info:
stdClass Object
(
[name] => Fred
[age] => 40
)
but the WSDL file is wrong
<message name="getPostcodeOut">
<part name="return" type="xsd:anyType"/>
</message>
Any ideas? Thanks.