Skip to end of banner
Go to start of banner

Add an Asynchronous (RPC) Service

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

This page describes how to add a standard RPC Service to the GWT client project. The web client typically uses this intermediary between other REST API calls and the actual client (JavaScript) application. This is done for a variety of reasons which are beyond the scope of this document.

Steps

  1. Create two java interfaces XXXService.java and and XXXServiceAsync.java in org.sagebionetworks.web.client.services where XXX is the name of your service.
    1. ex: DatasetService.java and DatasetServiceAsync.java
  2. In the XXXService interface, add the service's relative web path via the @RemoteServiceRelativePath annotation
    1. ex: @RemoteServiceRelativePath("dataset")
  3.  Create a class on the server side of the GWT project (in org.sagebionetworks.web.server.servlet) called XXXServiceImpl.java. It should extend RemoveServiceServlet and implement your XXXService interface.
    1. ex: DatasetServiceImpl.java
  4. Write a test for your ServiceImpl.
  • No labels