Part I, which is the first eight chapters of this book, provides an introduction to web services and tutorial material for the APIs and command-line tools that are provided by the J2EE 1.4 platform and the Java Web Services Developer Pack (JWSDP):
This chapter is a short but practical introduction to web services in general and to the support provided for web services by both the JWSDP and the J2EE 1.4 platform. The second part of this chapter provides a quick overview of the JAX-RPC API and shows how you might use it to create a client that can browse through the books available at Amazon.com, using that company's store-browsing web service.
For most web service developers, JAX-RPC is the most important of the APIs covered in this book. This chapter provides a basic introduction to JAX-RPC and shows you how to create a simple service and a client that can be used to access it, starting from a Java definition of the interface that the service provides. This chapter also discusses the use of both servlets and Enterprise JavaBeans (EJBs) to host JAX-RPC services and the tools that you need to build and deploy them.
While JAX-RPC is probably the most commonly used web service API, the SOAP with Attachments API for Java (or SAAJ) is the API that appeals most to those who like to see and understand what goes on "under the hood." SAAJ provides the means to create and receive raw SOAP messages. It requires you to build and decode each message at the XML element level. This chapter covers all of the SAAJ API, including the use of MIME attachments, which allow you to transfer arbitrary content, such as images and sound files.
JAXM is a development of SAAJ that provides asynchronous messaging and more reliable delivery. In this chapter, you'll see how to make use of these features and how to configure the reference implementation so that your JAXM clients can communicate with each other. This chapter also looks at the two SOAP message profiles, SOAP-RP and ebXML TRP, that are supported by the reference implementation.
The Web Service Description Language (WSDL) is an application of XML that lets you describe the interface to a web service in implementation-independent terms. One of the most useful features of WSDL is that it can be both created and consumed easily by software tools; as a result, you can use it to publish the interface to a web service implemented in Java or a different programming language, and create from the WSDL definition artifacts that allow clients for that service to be written in any language on any platform that has support for web services. Chapter 5 looks at the grammar of a WSDL document, preparing the way for the application of WSDL in Chapter 6.
This lengthy chapter starts by showing you how to use JAX-RPC to import a WSDL definition of a web service and then generate the Java interface and other classes required to let you build a client for that service. It goes on to demonstrate the wide range of powerful features that the JAX-RPC API provides, including support for both document- and RPC-based services, the use of MIME attachments with JAX-RPC web services, and SOAP message handlers, which let you process and extract data from or insert data into a SOAP message without modifying the code for the client or server that will generate or consume the message.
This chapter covers the Java API for XML-based Registries (JAXR). Registries allow organizations to publish their services so that would-be clients can discover them, learn how to access them and, eventually, do business using them. The JAXR API supports both the UDDI and ebXML registries in such a way as to make it possible to write a registry client application that can work with either of them without requiring any registry-specific code, while still allowing applications that need access to features that are offered by only one registry or the other to be created.
Both the JWSDP and J2EE 1.4 provide a number of tools that you need to use when creating web services. This chapter documents both the tools themselves and the configuration files that are required to control them.
Part II (Chapter 9 to Chapter 20) forms the API quick reference, which is a succinct but detailed API reference formatted for optimum ease of use. Please be sure to read How to Use This Quick Reference, which appears at the beginning of the reference section; it explains how to get the most out of these chapters.