This article is more than 1 year old

Time to balance WS-* and REST

Relative needs

The WS-* stack was conceived and driven forward by IBM and Microsoft, with other vendors cooperating on specifications where they had relevant expertise (Verisign on Security, BEA Systems on transactions and so on). The design philosophy was for a relatively simple and efficient basic mode of operation, with optional features added independently of each other.

More recently, though, something else has taken root among developers building distributed applications: Representational State Transfer (REST). As ever with technology, the debate over WS-* and REST has settled on the death of one technology and the rise of the other. The truth, though, lies somewhere in between.

WS-* is a veritable pyramid of specifications piled on top of Simple Object Access Protocol (SOAP) and Web Services Description Language (WSDL). The first addition was Universal Description, Discovery and Integration (UDDI), followed after a couple of years by WS-Security, then WS-Coordination, WS-Transaction, BPEL, WS-Manageability, WS-Addressing, WS-ReliableMessaging, WS-Federation, WS-MetadataExchange.

Both Java Enterprise Edition (Java EE) and .NET have extensive built-in support for serving and consuming web services. Indeed, as this list clearly shows, Java EE 5 includes no fewer than seven web service related specifications. On the Windows platform, Windows Communication Foundation (WCF) is now the default way of using web services from the .NET Framework. Thanks to IBM, WS-* even provides a suitable framework for building grid applications using WS-ReliableMessaging, WS-Distributed Management, WS-Notification, and WS-ResourceFramework. Good overviews of the vast extent of WS-* and related specifications are offered by Thomas Erl and innoQ (among many others). InnoQ also provides a color poster that graphically illustrates the sheer scale of the WS-* architecture.

Before SOAP was invented, back in 1998, there was Dave Winer's XML-RPC. In contrast to WS-*, XML-RPC was designed to make life easier for individuals and small organizations. Therefore it was kept extremely simple and lightweight, at the cost of giving up most of the sophisticated "optional extras" that WS-* offers. Alongside XML-RPC, a whole range of ad-hoc approaches to lightweight web services have sprung up. These are referred to generically as "XML-over-HTTP".

Which brings us to REST, that mysterious acronym that turns up so frequently in today's media, newsgroups, and blogs. REST is not a language, or a protocol, or an architecture. Strictly speaking, it is an architectural style - specifically, the architectural style of the web.

To build a RESTful web service, all you need to know is:

1. What are the resources to be served? (URIs)

2. In what format is the data encoded? (HTML, XHTML)

3. Which methods are supported by each URI? (GET, PUT, POST)

4. What status codes may be returned? (error, warning, information)

REST boils everything down to bare essentials: nouns (resources), verbs (HTTP operations), and data formats (usually XML applications). It is a cardinal principle that every separate method or function should have its own URI; and, ideally, URIs should never change or be withdrawn.

More about

TIP US OFF

Send us news


Other stories you might like