SOAP vs. POX vs. REST

November 6, 2006

So, we’ve got another of those REST-vs.-SOAP debates again … or, to be more exact, a SOAP-vs.-POX debate that has somehow turned into REST-vs.-SOAP. Whatever.

Sam Ruby started the discussion by referencing a piece from Leonard Richardson. WSO2’s Sanjiva Weerawarana chimes in:

So if you want security, reliability etc., you need SOAP (or you have to invent your own version of it and convince others to use it too .. good luck). Obviously not every scenario needs all that muscle: that’s why the approach taken by Apache Axis2 is the right way to deal with this: give a common programming model for both clients and services and let us middleware weenies worry about whether to SOAPify the requests and responses or not depending on your business policies.

As verified in a private email exchange, Sanjiva is very much aware that Axis2’s REST support is, in fact, only supporting POX. Mark seems to view this as another REST-vs.-SOAP debate; I don’t think it is.

So what’s the difference between POX/HTTP, SOAP, and REST?

So there can be RESTful SOAP applications, and RESTful POX applications, and non-RESTful SOAP applications, and non-RESTful POX applications, but no POX/SOAP combination.

Although I usually agree with Mark, I’ more with Sanjiva here: if you want to put message metadata into your XML, SOAP offers a standardized (and very simple) way to do so. No XML-based format one could invent would be any better, and even from a REST standpoint, using standard formats instead of proprietary alternatives is preferred.

As I’ve mentioned before, I don’t think the original debate started out as a REST-vs.-SOAP, but as a POX-vs.-SOAP discussion. Nevertheless, Steve Loughran has a great list of things you lose and gain by not using or using SOAP.

In my opinion, REST + standard XML formats, wrapped in SOAP where you need it, makes the most sense.

About

This page contains a single entry from Stefan Tilkov's Random Stuff posted on November 6, 2006 10:35 PM. The previous post in this blog was Deutsch oder Englisch?. The next post in this blog is Code Reads #4: Dijkstra's 'Notes on Structured Programming'. Many more can be found on the main index page or by looking through the archives.

Comments