Home > Articles > Programming > Web Services/ XML/ SOA/ WebSphere/ WCF

The Quickest Route To Implementing Web Services

Merrick J. Stemen
  • PrintPrint
  • Share ThisShare This
  • DiscussDiscuss
Close WindowMerrick J. Stemen

Merrick J. Stemen 

Learn more…

Sorry, this author hasn't posted any blogs.

Merrick Stemen looks at the fastest, easiest way to program web services and offers examples implemented in the Water language. This article compares a Water language web server program with the equivalent Java programming.

Despite having taught programming and computer science for more than 15 years, I'm still amazed sometimes; for example, when I discovered that I could do NetBIOS programming in FORTH, CGI scripts in FORTRAN, or an SMTP client in COBOL. (I was even amazed that I could actually write new games for the Mattel Intellivision game system.)

For programming web services, the biggest surprise has been the Water language and the Steam XML IDETM, the Water development environment and runtime engine by Clear Methods, Inc. of Cambridge, Mass.

The Discovery of Water

The thing that first attracted me to Water was a write-up in eWeek magazine describing Water as an answer to what the founders at Clear Methods considered to be some serious shortcomings in XML 1.0, and their suggestions for creating a language that was specifically written to deal with XML and web services. I downloaded the demo, and I was hooked.

Because I compulsively explore each new language I run across, I immediately began to devour every scrap of Water documentation I could find. I joined the Water language discussion group at Yahoo! and visited every link from Waterlanguage.org. I started writing short demo programs, trying out feature after feature, but my favorite feature is the ease with which you can turn any Water program into a web service.

Because Water is a language for web services, giving the programmer the ability to create a web service with a minimum of code is a priority. Here's a quick example. Suppose you want to deploy a web service that provides a random number from 1 to 20 (inclusive) to clients. In Water, the function might look like this:

<defmethod get_random >
  20.<random_number />.<plus 1 />
</>

In other languages, adding the functionality to allow someone to access that random number from a web browser client would add many lines of code to the simple random-number generator. In Water, you would simply add this line:

<server get_random port=5656 />

And voilà! Just point your browser at http://localhost:5656/?, and the random number comes right to the browser. No Apache web server, no Microsoft IIS—just Java and Steam XML.

With the new random-number server application on my machine, anyone who can access the machine across the network can get a random number. Even other applications can obtain the random number. Anyone else running Water on their machine could point at my machine to get random numbers for their programs just by adding this line:

<set a_random_number=<web "http://mstemens_machine:5656/?" />.result />

Very cool.

An equivalent program written in ASP or PHP might be as short as this one, but try running the ASP or PHP application on a machine that doesn't have a web server already on it. It just isn't going to work.

  • Share ThisShare This
  • Your Account

Discussions

Water testing
Posted Feb 5, 2009 02:04 PM by Tom Behman
0 Replies
Merrick Stemen
Posted Apr 16, 2008 06:56 PM by alex.pace1
0 Replies

Make a New Comment

You must log in in order to post a comment.

Related Resources

Emily NaveCommunity Tips: Starting a User Group Library
By Emily Nave on August 3, 20102 Comments

The Central Penn Adobe User Group (CPAUG) uses a library program to share books from different publishers with members. A short Q&A with group leader Megan Fister provides some great tips for starting your own.

Keep going with GWT
By Federico Kereki on August 1, 2010 No Comments

I've been using GWT for some years now, and I'm still contented with the easier way for web development. After having written a book on GWT development, doing a blog seemed a good idea for answering questions, and for further expanding topics that didn't get a place in the book.

Emily NaveUser Group Organizations: Finding Support in the Greater IT Community
By Emily Nave on July 29, 20102 Comments

Birds of a feather flock together, right? If you’re already a member of an established user group or looking for other like-minded technology evangelists, connecting with peers is an important part of being an active voice in the IT community.

See All Related Blogs

Informit Network