dev@jsr311.java.net

Asynchronous REST service

From: Hao He <Hao.He_at_objectconsulting.com.au>
Date: Wed, 16 May 2007 10:00:36 +1000

Hi,

One of a very patterns we found is what we call "Asynchronous REST service" [1].

"An asynchronous service needs to perform the following:

   1. Return a receipt immediately upon receiving a request.
   2. Validate the request.
   3. If the request if valid, the service must act on the request as soon as possible. It must report an error if the service cannot process the request after a period of time defined in the service contract.

Request Receipt

An example receipt is shown below:

<receipt xmlns="http://www.xml.org/2004/rest/receipt" requestUri = "http://www.example.com/xya343343" received = "2004-10-03T12:34:33+10:00">
  <transaction uri="http://www.example.com/xyz2343" status = "http://www.example.com/xyz2343?view=status"/>
</receipt>

A receipt is a confirmation that the server has received a request from a client and promises to act on the request as soon as possible. The receipt element should include a received attribute, the value of which is the time the server received the request in WXS dateTime type format. The requestUri attribute is optional. A service may optionally create a request resource identified by the requestUri. The request resource has a representation, which is equivalent to the request content the server receives. A client may use this URI to inspect the actual request content as received by the server. Both client and server may use this URI for future reference. "

So, how does this case go with the current REST API?

1. http://www.xml.com/pub/a/2004/08/11/rest.html?page=2

Hao