Tuesday, March 01, 2005

The future flavour of webservices

You've probably heard about webservices: they're those things that use SOAP, XML-RPC and a whole alphabet soup of technologies better left untouched. Another acronym to know is REST. It is the red-headed stepchild of webservice - the technology that IBM, Microsoft, BEA and all the others don't want you to know about. Why? Because it exists already. Your browser already uses REST to browse the web. Certain tools (like WebDAV) use REST to store and modify resources on the web. And where would we be without POSTs from forms?

SOAP and XML-RPC are both suites that allow you to exchange XML-encoded messages with other hosts on the network. Let's say you want to find all the top scoring players in the NHL. You prepare an XML document that describes your request and you POST it to a specific host that you know will actually respond. The URL you post to is called the "endpoint" and theoretically represents a resource or process. The host returns another (specially prepared) XML document that (once you un-wrap it) contains the list of players.

In REST things are much simpler. All you do is GET the URL. No fancy documents or anything. GET the URL and the server returns the list.

What is interesting however is the difference in viewpoint between what are now being called the WS-* camp (the SOAP and XML-RPC guys) and the RESTafarians.

The RESTafarians are very focussed on the semantic nature of URLs, often talking about the relationship between URLs and the resource representations they refer to. WS-* guys often talk about how the latest envelope spec can be enhanced.

In case you're wondering, I'm pretty much sold on RESTafarianism although I do like XML-RPC since it has a much simpler design/interface than SOAP.

Here is a very cogent introduction to the principles and philosophies of REST: http://naeblis.cx/rtomayko/2004/12/12/rest-to-my-wife

Here is the home of XML-RPC: http://www.xmlrpc.com

Here is the home of the SOAP working group: http://www.w3c.org/2000/xp/Group/

1 comment:

David Toub said...

there are also two nice articles on enterprise architecture, which incorporates SOAP and other services, in the latest issue of CIO:

http://www.cio.com/archive/030105/blueprint.html

http://www.cio.com/archive/030105/blueprint_sidebar_five.html