I create a complete pluggin in Wordpress using ZendFramework and now i'd like to expose a webservice to access the data because i need to create a c# importation application.
The problem i'm facing is that even though i set the type of a webservice return to a specific type, the classmap is not kicking in and transforming the type. For example:
/**
* Retursn all events registered on the sgm web interface
*
* @return models_event[]
*/
public function getAllEvents(){
return models_event::getEvents();
}
defines that the class returned in a models_event array. If i launch the WSDL section, i get a complex type added as "models_event" but heres what's wrong:
$autodiscover = new Zend_Soap_AutoDiscover(array(
'classmap' => array(
'event' => "models_event",
),
'encoding' => 'utf-8'
));
$autodiscover->setComplexTypeStrategy(new Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex());
$autodiscover->setClass('models_webservice');
$autodiscover->handle();
I class mapped models_event to event. So my WSDL should export the complex type:
<xsd:complexType name="ArrayOfmodels_event">
<xsd:complexContent>
<xsd:restriction base="soap-enc:Array">
<xsd:attribute ref="soap-enc:arrayType" wsdl:arrayType="tns:models_event[]"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="models_event">
<xsd:all/>
</xsd:complexType>
But as you can see it is returning a models_event[] complexe type and models_event complex type... i'm all messed up... Why is it doing this?