You should already have your backend REST resource available. On the client side (GWT) your need to
Add RestyGwt dependency to your project with maven
<dependency>
<groupId>org.fusesource.restygwt</groupId>
<artifactId>restygwt</artifactId>
<version>2.2.0</version>
</dependency>
Add the inheritance to your module file
<inherits name="org.fusesource.restygwt.RestyGWT"/>
Create your client interface
public interface PizzaService extends RestService {
@POST
@Path("pizzaorders")
public void order(PizzaOrder request,
MethodCallback<OrderConfirmation> callback);
}
Use your client where you want in you app
PizzaService service = GWT.create(PizzaService.class);
service.order(order, new MethodCallback<OrderConfirmation>() {
public void onSuccess(Method method, OrderConfirmation response) {
//code your stuff here
}
public void onFailure(Method method, Throwable exception) {
//code your stuff here
});