| |
Start Writing Web Services Today
This is everything you need to make your first move into Web services, regardless of your experience level. From the creation of a simplistic Java client to building and deploying both the client-side and the server-side of the exchange, we give you the tips and the code to get started with confidence.
by Kyle Gabhart
|
ow that the hype surrounding Web services has begun to subside, it's time to take a hard look at implementing this real-world technology. First, we'll analyze the basic architecture of a Web service and we'll explore a couple of Web service examples. Then we'll be ready to tackle some actual Java services. We will build a Java client, access a simple Web service, and then build a client to access a more complicated service.
Finally, we'll take a brief look at the current state of Web services and see what direction the technology and its emerging architecture seems likely to head.
| Editor's Note: This article (and its associated source code) has been modified from its original version. The original story used code that would run on the Alpha 3 version of Apache's Axis. With a Beta 1 version of Axis now available, we have updated the article and code to run on this later version. Please make sure that you are using the newer, Beta 1 version of Axis before you begin any project using this tutorial. |
Architecture of a Web Service
Three qualities set a Web service architecture apart from a comparable XML-driven Web-based application:
- published A Web service can be published to a remote registry
- locatedA Web service can be located by querying the remote registry with which it is registered
- invokedA Web service, once located, can be invoked across a network by sending an appropriate, XML-formatted request.
These characteristics are very important to understanding the architectural models that are being employed for Web services and the general motivation behind these technologies.
In a simplistic sense, Web services merely represent a further evolution in distributed computing technologies. They are a set of standardized technologies that operate on common protocols to facilitate the access of remote services in a standardized, vendor-neutral way. As these technologies mature, however, Web services will encompass additional features (security, transaction-handling, session-handling, etc.) to facilitate robust, dynamic business services.
Figure 1 displays a typical Web services architecture. XML requests are sent to the server and intercepted by a listener on the server. This listener ensures that the request is routed to the proper Web service on the server. The Web service parses the XML and fulfills the client request, probably invoking business services and perhaps even other Web services. If other business services are accessed, some type of middleware will likely be used (CORBA, EJB, JMS, DCOM, etc.). Part of the beauty of Web services is that the client need not be aware of what middleware the server uses. This decoupling allows for extensive scalability on the server without needing to make a single change on the client side of the interaction.
|