Have you implemented OpenMRS? Please participate in the Implementation Site Survey. If you already have, thank you!
This guide walks a module developer through adding a new set of web service methods for a core object. There is a separate guide for core developers.
The first thing to do is to read through the conventions section on the REST Web Services API For Clients page. Your module should follow similar conventions.
You will need to check out the webservices.rest project and mvn clean install it to make it available to your module project. You will also need to add a few dependencies in your module's pom.xml files:
Note that some of the controller dependencies (e.g. BaseCrudController) are now part of package org.openmrs.module.webservices.rest.web.v1_0.controller.
Our best-practices may change over the course of the sprint as we learn new things, but see the reportingrest module for an example module exposing web services.
The documentation on how to create methods is the same as for the core developers. See that page for more information.
The only difference is that on your controller you will use
The idgenws module was built as an example maven module that uses the restws code. It is a rudimentary example and does not use a lot of the helper parent classes. See http://svn.openmrs.org/openmrs-modules/idgenws/trunk
The reportingrest module was also built as a PoC. It is based on ant/build.xml and so the library setup, etc is slightly different than the maven example on this page. See the code for that here: http://svn.openmrs.org/openmrs-modules/reportingrest