Hello,

I recently got a basic xml rpc server running with zf and I have a question
about what "types" can be returned from services that are attached to
Zend_XmlRpc_Server (although I would also like to use the JsonRpc and Amf
eventually)

For example I have a class method that looks like:

/**
* This is a sample method
*
* @param struct $options
* @return struct $object
*/              
public function getObjectById($options = null) {                
                
        // ...
                
        // Does not work (Client gets empty array)
        return $object;
        
        // Does work (Client gets populated array)
        return $object->toArray();
}


My client calling code looks like:

$client = new Zend_XmlRpc_Client('http://myserver.com/v1/xmlrpc');
$result = $client->call('mynamespace.getObjectById',
array(array('id'=>12)));
var_dump($result)

As you can tell from the method definition, when I return the object the
client code ends up with an empty array, but when I return an array the
client code receives the data properly.

All my service classes return objects and paginators that implement
toArray() methods. 

I was under the impression the Zend_*_Server classes would automatically
handle objects being returned that have toArray()/toString() methods..

Is this not the case?

Thanks

-- 
View this message in context: 
http://n4.nabble.com/Returning-objects-collections-from-services-attached-to-Zend-Server-tp990133p990133.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to