Sunday, May 27, 2007

REST Battles SOAP for the Future of Information Services

There has been some subterranean discussion in the content management standards arena about what is the best way to support the interoperability of content services with applications. Should vendors support content services through the myriad of web services support layers that have been developed over the last decade? Or should we take a leap into the future with the simple REST architecture used by Amazon, Yahoo, Google and dozens of other web properties? The answer can affect how applications, developers and even consumers view information services. I don't think it is going to be as simple as let's do both.

more...

3 comments:

h.o.s.a.m.r.e.d said...

Additional useful URL regarding TO REST:

Wikipedia Page
http://en.wikipedia.org/wiki/Representational_State_Transfer


Building Web Services the REST Way
http://www.xfront.com/REST-Web-Services.html

Roy T. Fielding homepage
http://roy.gbiv.com/

Roy T. Phd where first describe REST
http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm

h.o.s.a.m.r.e.d said...

EST Web Services Characteristics
Here are the characteristics of REST:


* Client-Server: a pull-based interaction style: consuming components pull representations.
* Stateless: each request from client to server must contain all the information necessary to understand the request, and cannot take advantage of any stored context on the server.
* Cache: to improve network efficiency responses must be capable of being labeled as cacheable or non-cacheable.
* Uniform interface: all resources are accessed with a generic interface (e.g., HTTP GET, POST, PUT, DELETE).
* Named resources - the system is comprised of resources which are named using a URL.
* Interconnected resource representations - the representations of the resources are interconnected using URLs, thereby enabling a client to progress from one state to another.
* Layered components - intermediaries, such as proxy servers, cache servers, gateways, etc, can be inserted between clients and resources to support performance, security, etc.

Principles of REST Web Service Design

1. The key to creating Web Services in a REST network (i.e., the Web) is to identify all of the conceptual entities that you wish to expose as services. Above we saw some examples of resources: parts list, detailed part data, purchase order.

2. Create a URL to each resource. The resources should be nouns, not verbs. For example, do not use this:

http://www.parts-depot.com/parts/getPart?id=00345

Note the verb, getPart. Instead, use a noun:

http://www.parts-depot.com/parts/00345

3. Categorize your resources according to whether clients can just receive a representation of the resource, or whether clients can modify (add to) the resource. For the former, make those resources accessible using an HTTP GET. For the later, make those resources accessible using HTTP POST, PUT, and/or DELETE.

4. All resources accessible via HTTP GET should be side-effect free. That is, the resource should just return a representation of the resource. Invoking the resource should not result in modifying the resource.

5. No man/woman is an island. Likewise, no representation should be an island. In other words, put hyperlinks within resource representations to enable clients to drill down for more information, and/or to obtain related information.

6. Design to reveal data gradually. Don't reveal everything in a single response document. Provide hyperlinks to obtain more details.

7. Specify the format of response data using a schema (DTD, W3C Schema, RelaxNG, or Schematron). For those services that require a POST or PUT to it, also provide a schema to specify the format of the response.

8. Describe how your services are to be invoked using either a WSDL document, or simply an HTML document.

h.o.s.a.m.r.e.d said...

Good book about REST web services

RESTful Web Services