SOAP vs REST
Everyone who is bashing SOAP/WS-*, how much better REST is or how easy it is to get things done with Python and XHTML, or how bad Axis is...here's what i think:
Point #1:
Just use whatever tools you want/have and leave us alone :)
Point #2:
If you do want to engage, show us specifically how we could bridge the gap between REST and SOAP. Specifically by engaging on the specs in the standards bodies or by participating in discussions on how to go about doing this in open source tools like Axis. Yes, we are trying to bridge the gap in Axis2.
Point #3:
If you are crabby about tools like Axis not doing things right, then LOG A BUG, show up on the mailing lists, help with patches, it's open source for god's sake.
Comments
That's certainly an understandable position. I've even been known to submit a patch or two to Axis.
However, I have a few scenarios that I don't even begin to know how to approach. Example, how should Axis handle the following status code?
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.2
Posted by: Sam Ruby | July 23, 2005 01:24 PM
Sam,
Of course i was not referring to you :) One main difference is humans who use the browser to interact with the server know exactly what it means and know that they have to update bookmarks etc. But what do we do in the code is the question. Let's put this another way, what would the guy doing Python/XHTML handle this? suppose he is writing a cronjob that runs that code?
-- dims
Posted by: Davanum Srinivas | July 23, 2005 01:42 PM
Dims - here is a very related discussion, complete with related problems:
http://www.intertwingly.net/blog/2002/10/14/HTTP-301
At that time, the Radio Userland aggregator would follow the redirects, but would not change the subscriptions. Dave Winer then added a table to accumulates redirection info, and then added code to check the table.
Posted by: Sam Ruby | July 23, 2005 02:12 PM
Dims, that wasn't bug in Axis. It was a problem with the server I was communicating with.
Posted by: Robert Sayre | July 23, 2005 03:27 PM
Robert,
though my comments were triggered by your post, it was not a direct result of it...It has been stewing inside me for a while now. it's a general potshot :)
-- dims
Posted by: Davanum Srinivas | July 23, 2005 06:55 PM
Dims --
I won't argue whether AXIS (or JAX-RPC) is good or evil and when, but I think that AXIS gets a bum rap because people don't appreciate its role or place. Apache SOAP qualifies as an early prototype, and AXIS was the first product version built on the lessons learned. Few if any of the people who currently throw stones at AXIS/JAX-RPC/WS-* had the foresight or vision to throw those stone in advance. (Frankly, many of AXIS's flaws are inherited from JAX-RPC, IMHO...)
Folks should be thankful that hard work was invested to test ideas in a very public forum, that a useful but imperfect product resulted, and that a new version is underway.
You get a pat on the back for your hard work and a tip of my hat for getting back on the horse for the next lap.
Cheers.
-- Paul
Posted by: Paul R Brown | July 23, 2005 07:18 PM
"Specifically by engaging on the specs in the standards bodies"
Been there, done that. Quite often, the answer is "abandon this work" since its existence is necessarily counter to Web architecture. WSDL comes to mind. UDDI too. Ditto WS-MetadataExchange, WS-Addressing (more or less), and probably others I'm forgetting.
I also tried suggesting changes to Axis to support the SOAP 1.2 Web method feature, but those were nixed in favour of a change which didn't "shake the boat" so much and by treating the web method separately from the RPC operation. It's a total hack with inconsistent request and response semantics (for RESTful developers), since the Axis stack assumes protocol independence.
Posted by: Mark Baker | July 24, 2005 08:40 AM
Mark,
Could you please review what we are doing in Axis2? We absolutely want to do things the right way. This missive was part of that effort. To get enough info to do the right thing. We need your help :)
thanks,
dims
Posted by: Davanum Srinivas | July 24, 2005 10:05 AM
I think part of the problem is that it's still not clear to Axis developers what RESTful really means. Consider the RESTful "echo" example from http://ws.apache.org/axis2/rest-ws.html
Despite the "setDoREST(true)" bit, the call is still invoked via;
OMElement result = call.invokeBlocking("echo", payload);
So the operation is "echo", not the HTTP operation. That's what's gotta change in Axis for it to be usable RESTfully. Well, I'm oversimplifying a little bit, but that's basically it...
Posted by: Mark Baker | July 24, 2005 11:18 PM
So Mark, we've been here before :-).
What Axis2 is implementing is something that will fully support the WSDL2 HTTP binding with a common programming model for HTTP and for SOAP.
I know for a fact that doesn't meet your requirements of "supporting REST."
If you really want an API for doing REST (aka HTTP) then please use HTTPConnection or some such beast and be happy with it.
It makes no sense to do that in Axis2 (or Axis3 or Axis4 IMO); what we need is to support Web services as a unifying model for SOAP and REST both. The plan in Axis2 is to get that as right as possible. (Undoubtedly we won't get it right; hopefully it'll be closer than the previous iteration.)
Posted by: Sanjiva Weerawarana | July 25, 2005 10:42 AM
"It makes no sense to do that in Axis2 (or Axis3 or Axis4 IMO); what we need is to support Web services as a unifying model for SOAP and REST both."
SOAP can be used RESTfully, don't forget. My comment above was describing why the Axis2 APIs can't do that, easily. If there was a single place in the API for the "operation", then this would simplify things tremendously for developers.
Posted by: Mark Baker | July 25, 2005 12:11 PM
Is "invokeBlocking" new or old? http://ws.apache.org/axis2/api/org/apache/axis/clientapi/Call.html doesn't show it. If it's old, then that's good news, since the rest of the Call API looks pretty good to me; mostly just SOAPEnvelopes in and out (setAction scares me though). The setTransportType stuff could still be done better, because you need to be able to distinguish between, say, HTTP PUT and POST of a SOAP envelope, and it would be far more intuitive to specify that at send* invocation time, not setTransportType time.
I'm kind of working backwards there, from the existing API towards an improved one. Starting from scratch would be a nice luxury, since it's really not very hard to support both RESTful and RPC at the same time. It's a shame that the existing API embraces "protocol independence" so tightly - the root of all its problems in supporting RESTful interactions.
Posted by: Mark Baker | July 25, 2005 08:50 PM
I agree Axis2 lack a way to say is it GET or POST when it is HTTP. But when we design the API we work hard to make it "protocol independant". It is matter of different expectations and we have to cooose between :(
Posted by: Srinath Perera | July 26, 2005 01:56 AM
Unfortunately, Srinath, a "protocol independent" API - where the application semantics are independent of the underlying protocol - necessarily means an API unsuitable for RESTful use.
Posted by: Mark Baker | July 26, 2005 07:33 AM
Srinath,
We have a way of setting the transport (http / commons-http) why can't we add a way to specify some transport specific params (GET/POST) along with it?
-- dims
Posted by: Davanum Srinivas | July 26, 2005 07:46 AM
Setting the HTTP operation arbitrarily doesn't make sense. If you have some XML to send, it CANNOT be GET. If you have nothing to send then GET or POST is fine.
This is why what we really need to do is support codegen for the WSDL 2.0 HTTP binding. Then whatever is in the WSDL we can do.
An API for REST that satisfies Mark will never be an API for SOAP. Mark if that's not true please comment.
Sanjiva.
Posted by: Sanjiva Weerawarana | August 4, 2005 12:50 AM
Sanjiva,
+1 to "codegen for the WSDL 2.0 HTTP binding". BUT i think we can strike a balance that will satisfy everyone though we may have to draw the line somewhere. Let's us work thru the issues (comments here and on Savas' blog) and ask Mark to review the API again soon (after 0.95).
-- dims
Posted by: Davanum Srinivas | August 4, 2005 07:49 AM
I like the Apache example of sticking a REST EPR in a SOAP envelop. With that approach you could still use alot of the WS-* specs.
Posted by: Jim Thomas | September 21, 2005 01:19 PM