Newsletter sign-up
View all newsletters

Sign up for our Enterprise Java Newsletter

Enterprise Java

The Web at your (machine's) service

Use Web services to deliver information to a cell phone via SMS

  • Digg
  • Reddit
  • SlashDot
  • Stumble
  • del.icio.us
  • Technorati
  • dzone
The World Wide Web changes constantly. Since its inception, it has expanded exponentially, grown easier to navigate, and adapted effortlessly to new and innovative uses. However, thus far the Web's interface has been largely friendly to humans but unfriendly to machines.

Current technologies open up the Web only to humans through HTML links and URLs. Just imagine the services we could provide if machines could suddenly discover, traverse, and navigate the myriad of Web servers to facilitate true wide-area collaboration. Current approaches prove somewhat awkward: a common technique screen-scrapes HTML and mimics HTTP sessions to transfer data. Techniques such as these are not only incomplete (e.g., they lack a discovery mechanism) and unscalable (e.g., if one field on an HTML form changes, the whole interface can crash, so each server needs its own custom coding); they also prove difficult to maintain. Web services, on the other hand, provide a well-defined discovery and communication framework based on XML and HTTP that facilitates interaction between machines; they offer true peer-to-peer distributed computing over the Web. The advent of Web services has made the World Wide Web truly complete; they provide the missing link -- a machine-friendly user interface (UI) to the Web.

Admittedly, these concepts are not entirely new; distributed object-oriented technologies like CORBA and Remote Method Invocation (RMI) sought to provide similar services. Such core concepts as a service registry and TCP/IP-based communication protocol are common to both CORBA (registry/agent and Internet Inter-ORB Protocol (IIOP)) and Web services (UDDI and SOAP). But CORBA failed because it proved quite complicated and expensive to implement -- both in terms of cost and performance. Furthermore, the object bus could not create a genuine heterogeneous environment consisting of multiple hardware and software platforms. Web services, on the other hand, rely on ubiquitous technologies like XML and HTTP, and thus stand a fighting chance of being that ultimate Web glue.

This article develops a clearer understanding of Web services and illustrates a hands-on approach to developing an example service. We use our CellQuotes application presented in "Deliver Cellular Text Messages with SMS" (JavaWorld, March 2001) and demonstrate how to publish it as a Web service. Many expect SMS to be the next killer app for mobile phones; if Web services can provide a seamless coupling between the Web and mobile phones, we'll have an application that rocks, don't you think?

Web services 101

Web services offer the following advantages:

  • They are based on open and ubiquitous standards: Web services use omnipresent protocols such as HTTP for communication and XML for information exchange. Thus, they can work across hardware and software boundaries. For example, a Java Web service could easily talk to a COBOL Web service as long as HTTP and XML are in the mix.
  • They allow creation of business service stacks: By simply adding another layer, Web services expose software systems over the Internet. That allows the creation of value-added service stacks by melding discrete Web services over a network.
  • They enjoy broad-based industry support: Efforts like Microsoft's Hailstorm and Sun's ONE (Open Net Environment) are slowly turning Web services into a reality. IBM and Oracle are also major players in the Web services space. In addition, the open source movement's solid support ensures widespread developer interest.


Web services' greatest potential lies in their ability to provide business service stacks that truly integrate individual offerings. Imagine writing your own Web service agent that every morning collects and delivers information relevant to you (e.g., the HP-Compaq merger) from resources like the Wall Street Journal, the Economist, and BusinessWeek. Similar services exist today, but Web services help standardize machine-to-machine interaction to create new service breeds that integrate the Web as one large computer. On the supply side, you could publish your revolutionary service to millions of people worldwide without worrying about custom coding and interoperability issues.

  • Digg
  • Reddit
  • SlashDot
  • Stumble
  • del.icio.us
  • Technorati
  • dzone
Comment
Login
Forgot your account info?
Add comment
Anonymous comments subject to approval. Register here for member benefits.
Have a JavaWorld account? Log in here. Register now for a free account.
Resources