WSDL Elements

In this section, we take a closer look at each of the WSDL elements. To illustrate the discussion, we’ll use examples from the WSDL document that describe the JAX-RPC book service that you saw in Chapter 2. That particular web service was developed by starting with Java interface definitions, rather than from a WSDL file. If you already have a distributed application written in Java (perhaps using RMI) that you need to convert to a web service, this is the natural path to follow. However, in order to make the service generally available, you must create and publish a WSDL document. Fortunately, the wsdeploy utility provided with the JAX-RPC reference implementation generates a WSDL file from the information provided in its jaxrpc-ri.xml file together with the class files for the Java interfaces, thus saving you the trouble of trying to build one manually.

Tip

As described in Chapter 2, the wsdeploy utility creates the WSDL document for a web service while constructing a deployable web archive from a portable WAR file. If you just want to see what the WSDL document corresponding to a Java interface definition looks like, you can use the wscompile utility to generate it without having to first create a portable WAR file. See Chapter 8 for a description of how this can be done.

The WSDL file for the JAX-RPC book service, which is called BookQuery.wsdl, can be found in the web archive at chapter2\bookservice\Books.war relative to the installation directory for this book’s ...

Get Java Web Services in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.