O'Reilly logo

Java Web Services in a Nutshell by Kim Topley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required