Document Information

Last modified:
2009/05/18 21:21 by derrell

PHP RPC

qooxdoo includes an advanced RPC mechanism for direct calls to server-side methods. It allows you to write true client/server applications without having to worry about the communication details.

As described in the RPC overview, qooxdoo RPC is based on JSON-RPC as the serialization and method call protocol. This page describes how to set up and implement a PHP-based server.

Setup

The following information is from the README.CONFIGURE file of the RpcPhp contribution.

The simplest configuration of the PHP JSON-RPC server requires these steps:

  • Copy the services directory to the root of your web server’s data directory, e.g. /var/www


  • Ensure that PHP is properly configured. Try placing a file in the services directory called test.php which contains this data:
     <?php
     phpinfo();
     ?>

You should then be able to access http://your.domain.com/services/test.php and see the phpinfo() output. If not, you have a web server / php configuration problem to work out.

  • Configure your web server to load index.php if it’s found in a directory specified by the URL. By default, the web server probably looks only for index.html and index.htm, but you want it also to look for index.php.

Example

Please see RpcExample for an example of how to use an RPC backend.

To set up the RPC Example application:

1. Change directory into qooxdoo-contrib/trunk/RpcExample

2. Edit config.json such that the “path” inside of the “include” key properly points to the framework’s application.json file, and the QOOXDOO_PATH variable inside of the “let” key properly points to the root of the framework source tree.

3. Type “generate.py build”. That will create a “build” qooxdoo-contrib/trunk/RpcExample/build directory

4. Copy the contents of the build directory to the web server root directory called “test”, so your root contains ‘test’ and ‘services’. If you’re on Linux, the best way is with rsync:

  # mkdir /var/www/test
  # rsync -av ./build/ /var/www/test/

Note the slash after ‘build’ so that it copies the contents of ‘build’ into ‘test’, but not the directory ‘build’ itself.

4. Browse to http://your.domain.com/test/index.html and ensure that the echo test in the first tab runs, and then try the Rpc Server Functionality (async) test in the fourth tab.

Information

Last modified:
2009/05/18 21:21 by derrell

Account

Not logged in

 
 

Support qooxdoo! Vote for it!

Rich Ajax Platform (RAP)

RAP uses qooxdoo, Java and the Eclipse development model to build rich web applications. Read more...

qooxdoo Web Toolkit (QWT)

Similar to GWT this framework allows to create impressive qooxdoo applications just using Java. Read more...

Pustefix

Pustefix is a MVC-based web application framework using Java and XML/XSLT. Read more...

 
SourceForge.net Logo

Bad Behavior has blocked 0 potential spam attempts in the last 7 days.