Publisher review:lacertae - A code generation tool to help with GWT->PHP communication using JSON and POST requests This is a code generation tool that is supposed to simplify your life when wanting to create a PHP back-end for your GWT application. Given the following service Interface: public interface EchoService { public abstract String echo(String echo); }The code generation tool will create an abstract Async class that looks like this: public abstract EchoServiceAsync { public EchoServiceAsync(String URL); public final Request echo(String echo) { .. } public void echoError(Request request, Throwable exception) { .. } public abstract void echoResult(String arg0); }You will have to extend EchoServiceAsync and implement echoResult(). You can write a non-default implementation of echoError() to process any errors your own way. The echo() method is generated for you, and its task is to serialize all arguments passed to it using JSON, perform the POST request to the PHP back-end, deserialize from JSON the back-end's response and call echoResult() or echoError() depending on what happened. The echo() method will be generated to have the same arguments as the EchoService.echo() method. It will return a Request object you can use to track your request's progress. It should be able to serialize any POJO beans you define within your project as well as ArrayLists and HashMaps containing your POJO Beans. The echoResult() method will be generated to only take one argument. This argument will be of the same type as the return type of the echo() method defined in the service Interface. The echoError() method will be generated to always have the same arguments. The exception can be anything from failure to send the request, to 404 responses, to server thrown errors. The default implementation opens an alert window with the exception's message. Say you create this implementation for EchoServiceAsync: public class EchoServiceProxy extends EchoServiceAsync { public void echoResult(String arg0) { Window.alert('Server said : ' arg0); } }You can instantiate/call this class like so: EchoServiceProxy echoService = new EchoServiceProxy('http://example.com/EchoService.php'); echoService.echo('hello, world');
lacertae is a PHP script for Development Tools scripts design by rtaranu.
It runs on following operating system: Windows / Linux / BSD / Solaris.
Operating system:Windows / Linux / BSD / Solaris