RESTful Web Services » History » Revision 13
Revision 12 (chin-yeh, 10/12/2011 06:37 PM) → Revision 13/14 (chin-yeh, 10/12/2011 06:41 PM)
{{toc}}
h1. RESTful Web Services
h2. System Overview
!rest_json.png!
h2. Programming Guide
Below is the overview of the *web service layers*:
!component.png!
_Detailed Description:_
* *(1)* this is the only integration point for the client
* *(2)* this is the service layer that contains business logic
* *(3)* this is the persistence layer
* *(4)* this is the web service client, it could be web application, ajax application, batch program, as long as it can read or parse <code>JSON</code> formatted data
* *(5)* all of the components share the same domain objects
h3. How to add new web service method
We use the *Shopper* service to demonstrate how to add new web service method into the existing web service.
> the source file can be in the trunk, *connector-poc* in [[qconnector:wiki#SCM|SCM]]
The *Shopper* service provides:
* add new shopper
* update shopper profile
* retrieve shopper profile based on ID
In short, a new web service method should contain the following components(at least):
!mapping.png!
_Detailed Description:_
* *Controller* - this is the place where the client talk to
* *Services* - this is the business logic of the service
* *DAOs* - persist or query data from data source, e.g. database
h3. How to develop web service client
Any programming language which has the *RESTful* & *JSON* API. For the sample RESTful client, refer to the *com.ecosway.connector.poc.client* package in the *connector-poc* project in the [[qconnector:wiki#SCM|SCM]].