Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  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. Modify PortalServletModule (in org.sagebionetworks.web.server) to make your XXXServiceImpl class a singleton, and bind it to the path that you specified in the XXXService interface.
    1. ex:   bind(DatasetServiceImpl.class).in(Singleton.class);
              serve("/Portal/dataset").with(DatasetServiceImpl.class);
  5. Refresh your GWT Development server and you're (almost) all done.
  6. Write a test for your ServiceImpl.
    1. ex: DatasetServiceImplTest.java