On TheServerSide there are a bunch of wanks people, moaning yet again that SOAP and web services is too complicated. Like slashdot, the discussions on TSS quickly degrade into ignorance and childish interactions. (Hence the tone of this entry will be slightly deprecating)
Is the underlying problem here that SOAP is hard? No. Its that integration is hard. If you think that REST/POX is going to make it easier you are just crazy. Lets look at some of the things which are hard regardless:
- Understanding the operations – for both you need to figure out the inputs and outputs. For both you’ll most likeloy have schemas.
- Writing the operations – for both you’ll need to either construct some xml or some data transfer objects. In certain cases one will be easier than the other, and neither are specific to SOAP or POX.
- Describing the operations – whether its documentation or a wsdl document, you need to let users know how your service works.
Although I’m sure REST people wouldn’t use operations, but close enough.
And heres a little bonus on SOAP vs REST/POX for all of you who care…
Hey you enterprisey loser, REST/POX really is easier
Is it really? Why? Its all just XML anyway.
Are you complaining about how hard it is to write a WSDL straight off the bat? Then start with code first, and work your way to a more defined WSDL.
But this is nearly irrelavent, because the actual work comes in when you design your schemas. If you have an API of any decent size, the schemas are where the majority of the work will be. And you will need a schema regardless of whether you do POX or SOAP.
But REST/POX is better – look at Amazon!
One example I’ve always seen is the Amazon API. “Look the SOAP API is barely used.” However, I think this shows when SOAP should be used and when POX/HTTP approaches should be used. Amazon has hundreds of defined schema elements. The API encompasses a huge amount of functionality. But how much does the typical user need? A small small fragment. If you’re going to use the whole API I will guarantee that the SOAP API will be easier. Yet, for a small subset, their REST API will most likely be easier.
And this does nothing at all to debunk that SOAP services aren’t effective. I can generate a .NET or Java client with ease. While some have complained about how hard these are to use, I argue that it is only hard because the API contains so much functionality and the Amazon docs largely ignore the SOAP interface.
But there are interoperability problems!
The truth is now we’ve worked out most of the interoperability problems. I can go and use WSDL, SOAP, WS-Security, WS-Addressing, and a myriad of others across platforms. Just use a decent SOAP stack.
Enough already
Can we just accept that sometimes SOAP is good and sometimes REST/POX is good? Just like sometimes Java is good and sometimes Ruby is good. Or any number of things. Anyone who looks for One Thing To Rule Them All wil most likely be left empty handed or looking like a religious fanatic.