About This Tutorial

Who Should Use This Tutorial

Prerequisites

How to Use This Tutorial

About the Examples

Required Software xi

Building the Examples xi

How to Print This Tutorial

Typographical Conventions

Feedback

Chapter 1:   Building Web Services with JAX-WS

Setting the Port

Creating a Simple Web Service and Client with JAX-WS

Requirements of a JAX-WS Endpoint

Coding the Service Endpoint Implementation Class

Building the Service

Packaging and Deploying the Service

A Simple JAX-WS Client

Types Supported by JAX-WS

Web Services Interoperability and JAX-WS

Further Information

Chapter 2:   Binding between XML Schema and Java Classes

JAXB Architecture

Architectural Overview

The JAXB Binding Process

More About Unmarshalling

More About Marshalling

More About Validation

Representing XML Content

Java Representation of XML Schema

Binding XML Schemas

Simple Type Definitions

Default Data Type Bindings

Customizing JAXB Bindings

Schema-to-Java

Java-to-Schema

Chapter 3:   Using JAXB

General Usage Instructions

Description

Using the Examples

Configuring and Running the Samples

JAXB Compiler Options

JAXB Schema Generator Options

About the Schema-to-Java Bindings

Schema-Derived JAXB Classes

Basic Examples

Unmarshal Read Example

Modify Marshal Example

Unmarshal Validate Example

Customizing JAXB Bindings

Why Customize?

Customization Overview

Customize Inline Example

Datatype Converter Example

External Customize Example

Fix Collides Example

Bind Choice Example

Java-toSchema Examples

j2s-create-marshal Example

j2s-xmlAccessorOrder Example

j2s-xmlAdapter-field Example

j2s-xmlAttribute-field Example

j2s-xmlRootElement Example

j2s-xmlSchemaType-class Example

j2s-xmlType Example

Chapter 4:   Streaming API for XML

Why StAX?

Streaming Versus DOM

Pull Parsing Versus Push Parsing

StAX Use Cases

Comparing StAX to Other JAXP APIs

StAX API

Cursor API

Iterator API

Choosing Between Cursor and Iterator APIs

Using StAX

StAX Factory Classes

Resources, Namespaces, and Errors

Reading XML Streams

Writing XML Streams

Sun's Streaming Parser Implementation

Reporting CDATA Events

SJSXP Factories Implementation

Sample Code

Sample Code Organization

Configuring Your Environment for Running the Samples

Running the Samples

Sample XML Document

cursor Sample - CursorParse.java

cursor2event Sample - CursorApproachEventObject.java

event Sample - EventParse.java

filter Sample - MyStreamFilter.java

readnwrite Sample - EventProducerConsumer.java

writer Sample - CursorWriter.java

Further Information

Chapter 5:   SOAP with Attachments API for Java

Overview of SAAJ

Messages

Connections

Tutorial

Creating and Sending a Simple Message

Adding Content to the Header

Adding Content to the SOAPPart Object

Adding a Document to the SOAP Body

Manipulating Message Content Using SAAJ or DOM APIs

Adding Attachments

Adding Attributes

Using SOAP Faults

Code Examples

Request.java

MyUddiPing.java

HeaderExample.java

DOMExample.java and DOMSrcExample.java

Attachments.java

SOAPFaultTest.java

Further Information

Chapter 6:   Java API for XML Registries

Overview of JAXR

What Is a Registry?

What Is JAXR?

JAXR Architecture

Implementing a JAXR Client

Establishing a Connection

Querying a Registry

Managing Registry Data

Using Taxonomies in JAXR Clients

Running the Client Examples

Before You Compile the Examples

Compiling the Examples

Running the Examples

Using JAXR Clients in Java EE Applications

Coding the Application Client: MyAppClient.java

Coding the PubQuery Session Bean

Editing the Properties File

Compiling the Source Files

Starting the Application Server

Creating JAXR Resources

Packaging the Application

Deploying the Application

Running the Application Client

Further Information

Chapter 7:   Java XML Digital Signature API

How XWS-Security and XML Digital Signature API Are Related

XML Security Stack

Package Hierarchy

Service Providers

Introduction to XML Signatures

Example of an XML Signature

XML Digital Signature API Examples

validate Example

genenveloped Example

Chapter 8:   Securing Web Services

Securing Web Service Endpoints

Overview of Message Security

Advantages of Message Security

Message Security Mechanisms

Web Services Security Initiatives and Organizations

W3C Specifications

OASIS Specifications

JCP Specifications

WS-I Specifications

Using Message Security with Java EE

Using the Application Server Message Security Implementation

Using the Java WSDP XWSS Security Implementation

Further Information

Index