Thursday, August 14, 2008

AJAX Based Client and RESTful Web services

A RESTful web service is a web service built using REpresentational State Transfer architectural style. Ajax provides web development techniques used for creating interactive web application or rich internet application.

These two technologies (REST and AJAX) offer a new model for service oriented web application. Integration between these technologies is so simple. An AJAX front end implements a RESTful web service simply by invoking the RESTful URL with an HTTP method.

RESTful web services (unlike SOAP web services) do not mandate XML results or inputs to be enveloped with special protocol specific headers and message wrappers. It drastically simplifies the operations on the client by removing the need to preprocess the message headers and exposing the context of the message directly to the client’s parser.

JSON(JavaScript Object Notation) which is a text based representation for JavaScript data objects is the best format for data exchange between AJAX front end and RESTful web service. JSON simply is another text format with its own delineation rules. On the front end of AJAX application, JONS service response can be easily parsed, evaluated, and assigned to textual variables using JavaScript’s eval() function.

I realized that these two technologies are some of the most powerful and at the same time simplest ways to build lean, flexible, and service oriented web application.