Introduction

The Google Web Toolkit client-side library is the GWT module defintion of GWT-RPC API for this application. You can use the GWT Compiler to create JavaScript functions that can be used to access the API.

This GWT library provides all client-side code necessary to invoke an GWT remote procedure call. In accordance with the standard GWT project structure, the library provides all GWT RPC service interfaces (synchronous and asynchronous) and translatable objects in the "client" package of the main module. In addition to these classes, this library also provides support classes for actually making an RPC call with more type safety and without the need to configure the GWT ServiceDefTarget.

As an example, suppose there existed a service interface and method for reading a purchase order. A typical use of the library would like like this:

Example

//instantiate a new service... PurchaseOrderService service = new PurchaseOrderService(); //make the asynchronous remote call to read the purchase order... service.readPurchaseOrder("123456", new PurchaseOrderService.ReadPurchaseOrderResponseCallback() { onResponse(PurchaseOrder po) { //handle the purchase order as needed... } onError(Throwable error) { //handle the error as needed... } });

You would then compile this code using the GWT.