[PJUG Javamail] SOAP or REST?

Nimret Sandhu nimret at nimret.com
Wed Mar 18 21:17:23 EST 2009


On Wednesday 18 March 2009 04:31:53 pm Bill Jackson wrote:
> Yes, absolutely.  (I have never used these words before, but please
> remember this is my opinion and not necessarily my employer's.)  REST is
> self-contained, dead simple to use, and its descriptive URLs are a thing of
> beauty; IMHO, it is a no-brainer in cases where the complexity and overhead
> of SOAP make no sense.

to elaborate on the 'descriptive URLs' observation here, REST provides a more 
OO style RPC api while SOAP is more of a flat procedural style RPC interface. 
Eg: http://www.xfront.com/REST-Web-Services.html

REST uses HTTP specifically while SOAP is supposed to be protocol agnostic ( 
eg SOAP over SMTP).

SOAP is also more of an enterprise industry 'standard' so you may find more 
support for it in enterprise products which you might want to be 
interoperable with or provide interoperability for. REST appears to be more 
prevalent in the world wild web ( pun intended :) and not so much within 
products per se.

SOAP is built on top of XML ( request + response) while REST responses can be 
XML, JSON, binary data, whatever. Yeah, SOAP can also return those data types 
but you have the additional overhead of binding those to XML ( 
de+serialization).

As someone already recommended, I used ApacheCXF at my last job to implement 
both a SOAP and a REST interface. I used the JAX-WS spec to create the 
services which should allow switchable implementations with deployment 
changes only ( theoretically :)

Note that a browser fetching resources from the World Wild Web is an example 
of RESTful architecture.

regards -
-- 
Nimret Sandhu
http://www.nimret.com
http://www.nimsoft.biz


More information about the Javamail mailing list