Versions Compared

Key

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

...

Full example of adding new web service methods into your module.

Technical Documentation for Implementing Clients

Using ETag (available with OpenMRS v1.9.0 revision 20638 and higher)
The module also adds an ETag to response headers when presenting resources to clients. ETags have been implemented in shallow-mode (i.e. they save client bandwidth, but not server-side processing). As described here, as a client application you may want to look at ETag when making REST calls.

From the wikipedia article:

In typical usage, when a URL is retrieved the web server will return the resource along with its corresponding ETag value, which is placed in an HTTP "ETag" field:

Code Block
ETag: "686897696a7c876b7e"

The client may then decide to cache the resource, along with its ETag. Later, if the client wants to retrieve the same URL again, it will send its previously saved copy of the ETag along with the request in a "If-None-Match" field.

Code Block
If-None-Match: "686897696a7c876b7e"

On this subsequent request, the server may now compare the client's ETag with the ETag for the current version of the resource. If the ETag values match, meaning that the resource has not changed, then the server may send back a very short response with an HTTP 304 Not Modified status. The 304 status tells the client that its cached version is still good and that it should use that.
However, if the ETag values do not match, meaning the resource has likely changed, then a full response including the resource's content is returned, just as if ETags were not being used. In this case the client may decide to replace its previously cached version with the newly returned resource and the new ETag.

Downloads

View Source: http://source.openmrs.org/browse/Modules/webservices.rest/trunk/
Checkout Source: http://svn.openmrs.org/openmrs-modules/webservices.rest/trunk/
Download: http://modules.openmrs.org/modules/view.jsp?module= (To be updated once module is formally released)

...

For all features in the REST module to work you must use a nightly build of at least version 20404. This is due to

Jira Legacy
TRUNK-2323
TRUNK-2323
serverOpenMRS JIRA
and
Jira Legacy
TRUNK-2324
TRUNK-2324
serverOpenMRS JIRA

The REST Web Services module requires at least OpenMRS 1.9.0, 1.8.1, 1.7.2, or 1.6.3 to run.

...