[TYPO3-v4] REST API to CORE Functions

Helmut Hummel helmut at typo3.org
Mon Apr 19 09:05:11 CEST 2010


Hi Steffen,

On 18.04.10 14:28, Steffen Kamper wrote:
> 
> as i'm not familar with the Zend framework - is there an example of this
> implementation to look at?


If you mean how to access a XMLRPC service as a client, in case of the
typo3_weservice it would look like this:


$client = new Zend_XmlRpc_Client('http://host/rpc/');
$session =  $client->call('login', array('user', 'pass'));

// return the mountpoints of the user
$pages = $client->call('call',array($session, 'record.list'));

// return all records stored in page with id 1, the user has access to
$records = $client->call('call',array($session, 'record.list', array(1)));

That's it.


To have a Server you basically have to do the following:

$server = new Zend_XmlRpc_Server();

// register CRUD methids for the server
$server->setClass('Typo3Rpc_Records', 'call.record');

// register special system methods
$server->setClass('Typo3Rpc_Server_System_Calls', 'system');

// handle requests
$server->handle();


So without touching anything, it's really a oneliner to add new
functions tho the service. I planned that such classes could be
registered by extensions (which would also only be a foreach...)


Refer also to the Zend documentation:
http://framework.zend.com/manual/en/zend.xmlrpc.client.html
http://framework.zend.com/manual/en/zend.xmlrpc.server.html


Regards Helmut


More information about the TYPO3-project-v4 mailing list