Book description
Java SOA Cookbook offers practical solutions and advice to programmers charged with implementing a service-oriented architecture (SOA) in their organization. Instead of providing another conceptual, high-level view of SOA, this cookbook shows you how to make SOA work. It's full of Java and XML code you can insert directly into your applications and recipes you can apply right away.
The book focuses primarily on the use of free and open source Java Web Services technologies -- including Java SE 6 and Java EE 5 tools -- but you'll find tips for using commercially available tools as well.
Java SOA Cookbook will help you:
- Construct XML vocabularies and data models appropriate to SOA applications
- Build real-world web services using the latest Java standards, including JAX-WS 2.1 and JAX-RS 1.0 for RESTful web services
- Integrate applications from popular service providers using SOAP, POX, and Atom
- Create service orchestrations with complete coverage of the WS-BPEL (Business Process Execution Language) 2.0 standard
- Improve the reliability of SOAP-based services with specifications such as WS-Reliable Messaging
- Deal with governance, interoperability, and quality-of-service issues
The recipes in Java SOA Cookbook will equip you with the knowledge you need to approach SOA as an integration challenge, not an obstacle.
Publisher resources
Table of contents
- A Note Regarding Supplemental Files
- Preface
-
I. SOA Fundamentals
- 1. Introduction to SOA
-
2. XML Schema and the SOA Data Model
- Introduction
- Designing Schema for SOA
- Creating Canonical Data Model
- Using Chameleon Namespace Design
- Versioning Schemas
- Reference Schemas
- Common Schema Types
- Validating an XML Document Against a Schema
- Validating an XML Document Against Multiple Schemas
- Restricting Schema Types with Regular Expressions
- Using Schema Enumerations
- Generating Java Classes from Schema
- Generating a Schema from Java
- Generating Java Source Files from XML Schema in Ant
- Generating an XML Document Instance from a Schema
- Customizing How a Java Class Is Generated from Schema
- Validating Against a Schema During Marshaling and Unmarshaling
- Collecting Schema Validation Events During Marshaling and Unmarshaling
- Summary
-
3. Working with XML and Java
- Introduction
- Reading an XML Data Stream
- Writing XML Data Streams
- Filtering Data in an XML Stream
- Selecting Values from an XML Document
- Updating a Value in an XML Document
- Converting a Java Object into an XML Document Instance
- Converting an XML Document Instance into a Java Object
- Generating a Schema from an XML Document
- Converting XML to Java Without JAXB
- Customizing Code Generation in JAXB
- Finding the JAR That Contains a Given Class on Linux
- Transparently Substituting XML Files
- Summary
-
II. Web Services
-
4. Getting Started
- Introduction
- Using Publicly Available Web Services to Test Against
- Installing Metro
- Installing Oracle WebLogic
- Creating and Deploying the Simplest Web Service
- Creating and Deploying a Service to WebLogic
- Setting Up a Maven 2 Service and Client Project
- Understanding WSDL
- Using References in NetBeans to Generate Web Service Clients
- Monitoring SOAP Traffic with Metro
- Monitoring SOAP Traffic with TCPMon
-
5. Web Services with SAAJ
- Introduction
- Creating a SOAP Element with a Qualified Name
- Creating a Complete SOAP Message
- Writing a SOAP Response to an Output Stream
- Creating a Web Service Client Based on an Existing SOAP Envelope
- Extracting Content from a SOAP Message
- Creating a Web Service Client Using Raw XML Source and DOM
- Adding a MIME Header
- Adding Namespace Declarations
- Specifying SOAPAction
- Adding an Attribute to an Element
- Removing a Header from a SOAP Message
- Adding Headers to a SOAP Request
- Accessing All SOAP Header Elements
- Adding an Attachment to an Outbound SOAP Message
- Accessing Inbound Attachment Data
- Connecting to a SAAJ Endpoint Without a WSDL
- Working with SOAP Actors
- Asynchronous Invocation with Dispatch
- Validating Your Payload Against a Schema on the Client
- Providing a Web Service with SAAJ
- Sending and Receiving SOAP Faults
- Summary
-
6. Creating Web Service Applications with
JAX-WS
- Introduction
- Calling a Web Service from the Command Line
- Using JAX-WS Annotation Name Properties
- Invoking the Simplest Web Service
- Creating a Client Proxy
- Consuming a Web Service from a Servlet or EJB
- Consuming a Web Service from a JSP
- Using a JAXB-Annotated Instance in a SOAP Message
- Using wsimport in a Maven Project
- Dealing with Version Errors in wsgen and wsimport
- Adding Headers to a SOAP Request
- Intercepting the Request to Perform Protocol-Specific Work
- Intercepting the Request to Perform Work on Your Payload
- Sharing Data Between Handler Invocations
- Passing Binary Data in a Request
- Using Binary Data in a SOAP Message
- Enabling Binary Optimization on the Client
- Validating a SOAP Payload Against a Schema with Metro
- Making Asynchronous Calls with a JAX-WS Client
- Overriding the Endpoint Address in an SEI
- Summary
-
7. Providing SOAP-Based Web Services
- Introduction
- Assembling a Service for Deployment
- Determining a Service Development Model
- Choosing Encoding, Use, and Parameter Styles
- Generating a WSDL and Portable Artifacts Based on a Java Service Endpoint Implementation
- Creating a Basic Web Service
- Specifying Namespaces
- Creating a Web Service Operation
- Specifying a Web Service Message Part
- Specifying an Operation Return Value
- Defining Zero-Argument Operations
- Defining Operations with Void Return Type
- Creating a Web Service That Uses Complex Types Based on Custom WSDL and a Custom Schema
- Specifying the SOAP Binding Style, Use, and Parameter Style
- Configuring Standard Custom Bindings
- Excluding a Public Method from a Service
- Creating a Service Provider with an XML View
- Implementing Server-Side Handler Chains
- Providing Stateful Services
- Adding a Header with a Method Parameter
- Accessing Incoming Header Parameters in a Service
- Providing a Value for SOAP Action or WS-Addressing Action
- Optimizing Transmission of Binary Content on the Server
- Getting and Sharing Data About Users and the Request
- Using Header References with Holder<T>
- Summary
-
8. RESTful Web Services
- Introduction
- Creating a POX over HTTP Service with Servlets
- A RESTful Service with JAX-WS
- Creating a Client for a RESTful Service Using Sockets
- Application: Using SSL, Atom Publishing, and the Google Finance REST API
- Setting Up the Jersey JAX-RS Implementation
- Creating a Jersey Project with Eclipse and Tomcat
- Creating Hello World with Jersey
- Creating a Single Path for Variable Resources of the Same Type
- Restricting the Structure of Values in a Path Template
- Accessing Query Parameters
- Marshaling a Custom Type to XML in a Response
- Offering Different Representations of the Same Resource
- Creating a Resource
- Working with Forms and URIs
- Using SAAJ to Access a RESTful Service
- Setting Metadata on Representations
- Deleting a Resource
- Redirecting to Another Service
- Accessing HTTP Headers
- Working with Cookies
- Working with Exceptions and Response Status Codes
- Working with WADL
- Interacting with a Resource Using a Custom Reader and Writer
- Summary
-
4. Getting Started
-
III. Business Processes
-
9. Service Orchestrations with BPEL
- Introduction
- Determining a Process Design Method
- Selecting a Business Process Language
- Getting Apache ODE BPEL Engine
- Deploying a Process to Apache ODE
- Understanding BPEL Process Basics
- Using a Free Graphical Designer to Create BPEL Processes
- Creating a BPEL Process That Invokes a Partner
- Deploying a BPEL Process to OpenESB’s BPEL Service Engine
- Testing a Deployed BPEL Process
- Installing Active Endpoints BPEL Designer
- Installing Active Endpoints BPEL Engine
- Creating a BPEL Process in Active Endpoints Designer
- Deploying a Process to Active Endpoints Server
- Using Web Service Partners
- Invoking a Partner Service from a BPEL Process
- Manipulating Data with BPEL Variables
- Using Literals
- Concatenating Values
- Choosing an Activity to Execute Based on Runtime Conditions
- Executing Multiple Activities in a Sequence
- Using Logical Divisions to Group Activities
- Summary
-
10. Advanced Orchestrations with BPEL
- Introduction
- Executing Activities in Parallel
- Synchronizing Activities Executing in Parallel
- Doing Nothing
- Executing an Activity at a Specific Point in Time
- Executing an Activity After a Specific Delay
- Selective Event Processing
- Handling Faults
- Explicitly Throwing a Fault
- Stopping a Process
- Performing an XSL Transformation on BPEL Message Data
- Validating Inbound Message Data
- Correlation Sets
- Looping
- Adding Human Tasks to a Business Process
- Invoking a RESTful Web Service from BPEL
- Summary
-
11. SOA Governance
- Introduction
- Assigning Roles
- Creating a SOA Roadmap
- Keeping Track of Your Services
- Determining a Data Ownership Scheme for Services
- Handling Legacy Programs and Heterogeneity Within Your SOA
- Documenting Services
- Setting Up a Service Registry
- Packaging Related Services
- Retiring a Service
- Browsing a UDDI Registry
- Querying a UDDI Registry Programmatically
- Understanding SOA ROI
-
9. Service Orchestrations with BPEL
-
IV. Interoperability and Quality of Service
-
12. Web Service Interoperability
- Introduction
- Dealing with Arrays
- Abstracting Addressing
- Using Addressing in a Java Service
- Explicitly Enabling Addressing on the Client
- Explicitly Disabling Addressing on the Client
- Abstracting Addressing in the Transport Layer from WSDL
- Addressing Faults
- Creating a .NET Web Service Client in Visual Studio
- Creating a .NET Web Service Client in C#
- Creating a .NET Web Service
- Creating a Ruby Client for a Web Service
- Creating a Ruby Client for a .NET Service
- Conforming to the Basic Profile
- Automating Testing for Basic Profile Conformance
- Interoperability Best Practices
- Using Modular WSDLs
- 13. Quality of Service
- 14. Enterprise Service Bus
-
12. Web Service Interoperability
- Index
- About the Author
- Colophon
- Copyright
Product information
- Title: Java SOA Cookbook
- Author(s):
- Release date: March 2009
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9780596520724
You might also like
book
SOA with Java: Realizing Service-Orientation with Java Technologies
“An outstanding depth-and-breadth resource for IT architects and Java professionals to understand and apply the marriage …
book
Java Web Services: Up and Running
This example-driven book offers a thorough introduction to Java's APIs for XML Web Services (JAX-WS) and …
book
Java EE 8 Recipes: A Problem-Solution Approach
Quickly find solutions to dozens of common programming problems with the Java Enterprise Edition Platform for …
book
Building Web Services with Java: Making Sense of XML, SOAP, WSDL, and UDDI, Second Edition
Sams has assembled a team of experts in web services to provide you with a detailed …