The Artima Developer Community
Sponsored Link

Java Buzz Forum
Web Service Tools

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Russell Beattie

Posts: 727
Nickname: rbeattie
Registered: Aug, 2003

Russell Beattie is a Mobile Internet Developer
Web Service Tools Posted: Mar 13, 2004 11:49 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Russell Beattie.
Original Post: Web Service Tools
Feed Title: Russell Beattie Notebook
Feed URL: http://www.russellbeattie.com/notebook/rss.jsp?q=java,code,mobile
Feed Description: My online notebook with thoughts, comments, links and more.
Latest Java Buzz Posts
Latest Java Buzz Posts by Russell Beattie
Latest Posts From Russell Beattie Notebook

Advertisement
Okay, some continuing thoughts about Web Services as Unix-like Software Tools. Les just left a message about STDIN/STDOUT/STDERR which made me realize I forgot about STDERR. That's important to remember because Unix tools can take in a chunk of data and send it out the other side, and also give you messages about what's happening all at the same time. The web just has request/response by default, so we'll have to come up with where to put that third channel. But let's put that aside for a sec and look at the other analogies:

1) The Endpoint is the App. So what I'm saying here is that just like grep does one thing and one thing well, an Web Service Tool should be the same way. http://example.com/tools/grep for example, would just process text the same way that grep does it. Grep doesn't try to be a universal editor or RegEx library or whatever, it just does it's one thing and does it well.

2) The Params are the Options. Almost all Unix tools have a host of options that can be passed to the app along with STDIN. Using our grep analogy, it would look something like this: http://example.com/tools/grep?extended-regexp=true&word-regexp=true&invert-match=true. Who knows, maybe these params would include URLs for other resources (like the --file option).

3) STDIN is an HTTP POSTed stream of data (or null if using GET), STDOUT is the HTTP Response. I was stressing XML before, but maybe that doesn't have to be the case. Say you wanted to have a Web Service Tool make a thumbnail of an image? Well, you post the file to the tool, with params, and get your result back. Though I think XML is what's going to provide the highest level of interop for most things, at the base level, it doesn't have to be.

4) Piping and STDERR are provided as URLs to other tool endpoints. Here's where the easy analogies stop, I think. There needs to be a place for STDERR to go and there needs to be a way to pipe the STDOUT results to another tool. It seems to me that both are simply additional URL endpoints, but the implementation of this is the part that's sketchy.

Where is a good place to put those URLs for the tool to get to them? Hmmmm. The simplest place would be in the params. But that would create long and ugly GET strings. Not that the traditional command line doesn't get ugly, but we wouldn't have a $PATH to help us cut the length down. Ooh - unless there was a central repository of endpoints out there... like a DNS system for Web Tools. Or like Les said, a TinyURL type system. Neat idea, but for another post. The other place is within the POST itself. Like the Atom API is currently doing, they could go in custom headers: X-STDOUT and X-STDERR headers could provide URLs where the Web Service Tool would POST the results to. This seems the most flexible since, like I said in Thought Three, the data being sent doesn't have to be XML, which would prevent having a custom XML envelope or something.

Actually, now that I think about it, having the info in both places would be fine and the tool just has to look in both places, the params overiding the headers (which would make it great for testing, etc.).

Cool! So there you go. Web Services as Unix Software Tools. If I was feeling energetic I'd whip up an example or two. I do have one reservation. I like all that above since it parallels with Unix so well, however I wish that XML played a bit more of a role since I think that's where the interop is really going to come to fruition. But maybe this model is more flexible and simple, which is really the Unix way. XML can be relegated to the Application level in all this and not lower in the OSI model...

Okay, thoughts welcome. I'm already thinking up edge cases already - like why not have STDIN be an optional overriding param as well so you can just use GETs everywhere and would enable "sideloading" type functionality as well? This would be cool to enable use of the tools from something as simple as a mobile WAP browser, right?

Cool stuff... anyone grok what I'm getting at?

-Russ

Read: Web Service Tools

Topic: Where is Jini? Previous Topic   Next Topic Topic: DB2 DataSources and Tomcat5

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use