More on REST

Mark continued our conversation with a comment on my recent post. Here's the text:

Tim, REST doesn't constrain you to using HTTP, it only constrains you to using uniform operations. *Many* other protocols can be used in this fashion, including NNTP (which, FWIW, is where HTTP got its "POST" operation), FTP (notice how clicking an ftp URI behaves the same as an http URI?), SMTP. Some are a bit troublesome to use uniformly, such as POP3 since it's quite stateful. And some, such as
telnet, well, just forget about it. 8-) Said another way, REST constrains you to use all resources (no matter which URI scheme they may be identified with) as if an HTTP proxy were in front them.

Unfortunately, "input" and "output", as commonly understood (i.e. WSDL) aren't operations, e.g. "input" and "getStockQuote". FWIW, the "ProcessMessage" style, which isn't REST, also uses this architectural constraint. See the post and discussion here;

I guess I'm confused then. If REST is essentially the notion of uniform operations, I don't see that in conflict with what basic Web services do. There are two ways to look at a Web service interface as defined in WSDL. One is to say that all services have at most four operations: input, input/output, output, and output. The messages that flow back and forth are arguments to those operations. An input argument (an XML message) that is interpreted by the service, which responds with an output argument (another XML message). Not all services respond to the same set of input messages, somehow you have to know what to send (from WSDL). This strikes me as very similar to HTTP. All Web sites respond to HTTP GET. The browser sends an input argument (an URL and querystring) and the service produces an output argument (a data stream). Not all sites respond to the same set of URLs, somehow you have to send (from links in an initial stream downloaded to a browser).

The other way to look at a Web service interface as defined in WSDL is to say that it's really the operations named in the portType. In that case, you can think of a service interface as similar to a protocol for using TCP. The particular messages you send and what they mean vary from service to service, the same way they do with, say, FTP and Telnet. From this perspective, a WSDL interface represents a protocol that multiple services and clients share. Now I suppose one could argue that those WSDL interfaces interfaces aren't uniform in the sense of being used across the entire Internet, but does that matter? If I'm working on a system inside a company or with a set of business partners, isn't sharing with them sufficient to be considered both useful and successful? And of course we may yet see some standard interfaces develop that lot's of clients and services use to communicate.

I think a lot of the confusion about WS and REST comes from an expectation that the WS stack will define a single standard interface. The point of WS, however, is really to allow application developers to build the interfaces THEY need. Some of those will become standard, many will not. But that doesn't mean they won't have succeeded in solving their particular problem. In short, I don't think of the goals being very different, it seems more a matter of scope to me.


Posted Oct 01 2004, 05:25 PM by tim-ewald

Comments

Dilip wrote re: More on REST
on 10-01-2004 3:39 PM
Tim
Not to side-track this very interesting discussion but do you have any insights into this comment?
http://pluralsight.com/blogs/tewald/archive/2004/09/30/2500.aspx#2536

Tim wrote re: More on REST
on 10-01-2004 3:59 PM
Mark Baker wrote re: More on REST
on 10-01-2004 7:39 PM
Very nice, Tim, you're totally getting to, IMO, the heart of the matter. Sorry, I must have misunderstood your input/output comments earlier.

"I guess I'm confused then. If REST is essentially the notion of uniform operations, I don't see that in conflict with what basic Web services do."

I'm thrilled that you hold this view. It's why I've said for some time that REST and the Web is what Web services proponents have been looking for all along.

Then you talked about the other sytle of Web services; "From this perspective, a WSDL interface represents a protocol that multiple services and clients share."

Absolutely! Just like an application protocol.

"If I'm working on a system inside a company or with a set of business partners, isn't sharing with them sufficient to be considered both useful and successful?"

Sure. I've built systems like this in the past, and some were successful, no doubt. But what happens when you want to add (integrate with) new partners? The cost of joining that little network is that one has to write software to process their specific APIs and data formats. Adopting a standardized interface necessarily lowers the integration cost since the new partner probably has a lot of software (e.g. HTTP clients & servers) which can *already* (without modification) use those APIs (which obviously doesn't impact the data problem - that's another crusade 8-).

Now consider other similar networks out there, and if they used this same standardized interface; integrating those networks together would be far simpler. If we assumed that everybody was already using the same, standardized data schemas (just to make the comparison easier), then integration complexity would be O(N) in that case, and O(N^2) in the non-standardized/specific interface case (worst case, assuming each network needed to interact with each other network).

And that, in a nutshell, is why the REST proponents like myself continue to raise such a fuss.
Tim wrote re: More on REST
on 10-02-2004 11:16 AM
I'm not sure I agree, Mark. I tend to think of the URL structure a site uses as its API. I can't easily adapt to that API because it isn't actually standard across sites. If I want to do any kind of really deep integration, I have to understand the target site's URL model. And I have to make sure I respond to changes if it changes. Otherwise I get broken links. In fact, the presence of broken links suggests that reliable integration is pretty difficult. In fact, isn't it more likely that we could standardize the message formats used by web services in a given field, say, the financial sector, than the URL structure used by all the different sites that expose that information?

Tim-
Mark Baker wrote re: More on REST
on 10-02-2004 5:51 PM
No Tim, the URLs are just identifiers, like EPRs. Their use is a function of the data which encapsulates them, so there's no need to standardize on the URIs themselves. For example (dunno what kind of escaping I need in these comments ...), <foo:Customer xlink:href="http://example.org/some-uri"/> for that to be successfully processed, all that needs standardizing is the semantics of foo:Customer (xlink:href is already done, of course).
Resting wrote re: More on REST
on 10-12-2004 12:05 PM
Perhaps Sean McGrath and Patrcik Logan have cut to the heart of the matter:

http://seanmcgrath.blogspot.com/2004_10_10_seanmcgrath_archive.html#109759903932009995
XML Eye for the Object Guy wrote Still RESTless
on 10-18-2004 7:40 AM
vohlobecqq wrote re: More on REST
on 03-22-2009 3:24 PM

Qt4T9G  <a href="uevyfpgpavbp.com/.../a>, [url=http://qgfbshojmajg.com/]qgfbshojmajg[/url], [link=http://oslvjbkxxxuu.com/]oslvjbkxxxuu[/link], http://mifcvnqcxain.com/

pbxiuo wrote re: More on REST
on 05-01-2009 12:55 AM

pkjwHz  <a href="dsoiypzzwywb.com/.../a>, [url=http://dlyrtrgsnenm.com/]dlyrtrgsnenm[/url], [link=http://hshjfqzeovip.com/]hshjfqzeovip[/link], http://zjaxakydhrvq.com/

Add a Comment

(required)  
(optional)
(required)  
Remember Me?