O'Reilly logo

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

Java and SOAP

Book Description

Java and SOAP provides Java developers with an in-depth look at SOAP (the Simple Object Access Protocol). Of course, it covers the basics: what SOAP is, why it's soared to a spot on the Buzzwords' Top Ten list, and what its features and capabilities are. And it shows you how to work with some of the more common Java APIs in the SOAP world: Apache SOAP and GLUE. In addition to covering the basics such as the structure of a SOAP message, SOAP encoding, and building simple services using RPC and messaging, Java and SOAP covers many topics that are essential to real-world development. Although SOAP has native support for an impressive number of object types, the nature of modern programming means that whatever SOAP gives you is not enough. When do you need to add support for your own object types, and how do you do it? How do you handle errors, and how do you add your own information to Fault messages? How do you handle attachments? In an ideal world, you could live entirely within Java, and ignore the SOAP messages being send back and forth: you'd be able to write Java code and let the SOAP APIs work behind the scenes. However, we're not yet in that ideal world, and won't be for some time. Therefore, Java and SOAP pays particular attention to how SOAP messages are encoded. It doesn't just explain the document types, but shows how the documents are used in practice as they are generated by the different APIs. If you ever have to debug interoperability problems, you'll find that this information is indispensable. We've always found that the best software is written by people who understand what's happening under the hood. SOAP is no different. Let's say you need to write a custom serializer to create a SOAP representation of a structure. How do you know that your encoding is efficient? There's one definitive answer: look at the SOAP documents it produces! Java and SOAP also discusses interoperability between the major SOAP platforms, including Microsoft's .NET, SOAP messaging, SOAP attachments, message routing, and a preview of the forthcoming AXIS APIs and server. If you're a Java developer who would like to start working with SOAP, this is the book you need to get going.

Table of Contents

  1. Copyright
  2. Dedication
  3. Preface
    1. Intended Audience
    2. A Moment in Time
    3. How This Book Is Organized
    4. Conventions Used in This Book
    5. How to Contact Us
    6. Retrieving Examples Online
    7. Acknowledgments
  4. Introduction
    1. RPC and Message-Oriented Distributed Systems
    2. Self-Describing Data
    3. XML
    4. API Specs Versus Wire-Level Specs
    5. Overview of SOAP
    6. SOAP Implementations
    7. The Approach
    8. Getting Started
  5. The SOAP Message
    1. The HTTP Binding
    2. HTTP Request
    3. HTTP Response
    4. The SOAP Envelope
    5. The Envelope Element
    6. The Header Element
    7. The actor Attribute
    8. The mustUnderstand Attribute
    9. The encodingStyle Attribute
    10. Envelope Versioning
    11. The Body Element
    12. SOAP Faults
  6. SOAP Data Encoding
    1. Schemas and Namespaces
    2. Serialization Rules
    3. Indicating Type
    4. Default Values
    5. The SOAP Root Attribute
  7. RPC-Style Services
    1. SOAP RPC Elements
    2. A Simple Service
    3. Deploying the Service
    4. Writing Service Clients
    5. Deploying with Request-Level Scope
    6. Deploying with Session-Level Scope
    7. Passing Parameters
  8. Working with Complex Data Types
    1. Passing Arrays as Parameters
    2. Returning Arrays
    3. Passing Custom Types as Parameters
    4. Returning Custom Types
  9. Custom Serialization
    1. Custom Type Encoding
  10. Faults and Exceptions
    1. Throwing Server-Side Exceptions in Apache SOAP
    2. Creating a Fault Listener in Apache SOAP
    3. Throwing and Catching Exceptions in GLUE
  11. Alternative Techniques
    1. SOAP Messaging
    2. Literal Encoding
  12. SOAP Interoperability and WSDL
    1. Web Services Definition Language
    2. Calling a GLUE Service from an ApacheSOAP Client
    3. A Proxy Service Using Apache SOAP
    4. Calling an Apache SOAP Service from a GLUE Client
    5. Accessing .NET Services
    6. Writing an Apache Axis Client
  13. SOAP Headers
    1. Apache SOAP Providers and Routers
    2. Replacing the Provider and Router Classes
    3. An Apache SOAP Service That Handles SOAP Headers
  14. JAX-RPC and JAXM
    1. JAX-RPC
    2. Working Without Ant
    3. Creating a JAX-RPC Service
    4. Creating a JAX-RPC Client
    5. Generating Stubs from WSDL
    6. Dynamic Invocation Interface
    7. JAXM, in Less Than a Nutshell
    8. What Next?
  15. Colophon
  16. Index