Search This Blog

Saturday, February 2, 2008

Support for RESTful Web Services

The term REST, standing for Representational State Transfer, was coined
by Roy Fielding in his 2000 PhD dissertation, surely one of the most
influential academic studies of recent years. Fielding's dissertation
title "Architectural Styles and the Design of Network-based Software
Architectures" emphasizes that creating a RESTful application implies
a style, or way of thinking about the problem, not a rote application
of rules, but the underlying rule is that the HTTP methods of GET, POST,
DELETE, PUT, OPTIONS and HEAD should each be used only for specific
purposes... The central problem of a Web service is interpreting a
request and routing it to the correct process so that the desired
representation if returned. SOAP-based services not only have to look
at the request headers, but also have to parse the XML formatted request
body and return XML formatted text. RESTful services only have to
examine the request headers and URL to determine the process to handle
the request and the resource representation to return. It is important
to remember that a given resource can have several different
representations. For example, an appointments calendar might be returned
as text, HTML, XML, PDF or an image... In recognition of the number
of developers turning away from SOAP to the REST style, the W3C working
group incorporated what they term "HTTP support" in the recently
released WSDL 2.0 specification. This version, many years in the making,
is a major revision of version 1.0 with reorganization supposed to
reduce complexity. In theory, a WSDL 2.0 document can describe a
service as both a SOAP and a REST application. The tools previously
used to create Web services from WSDL documents will need major
modification to work with WSDL 2.0... One of the open-source projects
being carried out under the GlassFish umbrella is WADL - the Web
Application Description Language. A WADL document gives an XML formatted
description of a REST style Web service suitable for machine processing
to create a Java client... The increasing industry buzz about REST has
induced developers of Web service related tools such as standards,
language libraries, and IDEs to explore new ideas... Right now, if I
had to write a simple RESTful Web service, I would just write my own
Java servlet implementation of the request interpretation. For describing
the service so other people could build clients, I would write a plain
text explanation supplemented with a WADL description.

No comments: