Thursday, June 19, 2008

Rest aside your web services

If you've been thinking of web services and feeling scared of that XML mess in the web service description (wsdl) files. Well, rest aside that scare now. And, by rest I mean, Representational State Transfer (REST).

Representational state transfer (REST) is a style of software architecture for distributed hypermedia systems such as the World Wide Web. And thus invariably it could be also implemented in the world of web services as another revolutionary way of communication with web services. In REST, resources have URIs and are manipulated simply through HTTP header operations. Therefore, now one can imagine having a web service without all that WSDL clutter.

REST works around a very simple principle, i.e. HTTP methods POST, GET, PUT and DELETE can be compared with the CREATE, READ, UPDATE, DELETE (CRUD) operations associated with database technologies or any application model objects.

The following table associates several common HTTP verbs with similar database operations, however the meaning of the HTTP verbs do not correspond directly with a single database operation. For example, an HTTP PUT is used to set the value of a resource and may result in either a creation or update as needed.

POST Create, Update, Delete
GET Read
PUT Create, Update

I hope thats enough for a theoretical introduction. Now for those who are eager to try cooking some code, here is the recipe.

The Netbeans Tutorial - Getting Started with RESTful Web Services

No comments: