To use RPC, write 3 components:
1.Define (ClientService interface) extends RemoteService & lists all RPC method.
2.Create (ServerServiceImpl class) extends RemoteServiceServlet & implements methods.
3.Define (ClientServiceAsync interface) to be called from client-side code.
Calling the remote procedure call:
1.Create the proxy class
private ClientServiceAsync clientServiceSvc = GWT.create(ClientService.class);
2.Initialize proxy , set up callback object & make call to the remote method.
Initialize: clientPriceSvc = GWT.create(ClientPriceService.class);
Set up callback: AsyncCallback
No comments:
Post a Comment