In Chapter 2, you saw how simple it is to create a web service using JAX-RPC by starting with a service definition in the form of a Java interface. Given such definitions and a configuration file, the wscompile and wsdeploy utilities can generate the Java code necessary to link both the client and server implementations to the underlying JAX-RPC infrastructure that ultimately creates or consumes SOAP messages. Although this is convenient for Java developers, it is not really acceptable to describe web services ”which are supposed to be platform- and language-independent ”using the type definition system of a programming language. The JAX-RPC book service created in Chapter 2, for example, uses a command-line client written in Java. In the real world, the client might instead need to be written in VB.NET, C#, or C++, or somebody might want to take the service definition and create an alternative server-side implementation on a different platform, such as Microsoft's .NET. In both of these cases, having the service defined in terms of Java interfaces is not particularly helpful.
The Web Service Description Language (WSDL) is an XML vocabulary that can be used to describe web services in both a platform- and programming language-neutral fashion. Web services defined by WSDL documents are published in a registry. Programmers can then either create their own implementations of these services, or develop clients to consume them by obtaining the WSDL definition and interpreting it in terms of the programming language of their choice. This task is made easier by the availability of tools that can parse WSDL and automatically generate the code necessary to build and decode the SOAP messages used by a web service, thereby freeing developers to concentrate on the business rules of the application instead of the network-level plumbing. In this chapter, we take a brief look at the structure of a WSDL document, and in Chapter 6, you'll see how to use JAX-RPC to implement a web service given a WSDL definition.
This chapter covers WSDL Version 1.1, the specification for which can be downloaded from http://www.w3.org/TR/wsdl. WSDL 1.1 was submitted by IBM, Microsoft, and Ariba and is widely used, but it is not a W3C standard. At the time of the writing, W3C is defining a new version of WSDL that will eventually become the endorsed standard.