The Definitive Guide
to SOA
Oracle® Service Bus
SECOND EDITION
Jeff Davies, David Schorow, Samrat Ray,
and David Rieber
The Definitive Guide to SOA: Oracle Service Bus, Second Edition
Copyright © 2008 by Jeff Davies, David Schorow, Samrat Ray, and David Rieber
All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means,
electronic or mechanical, including photocopying, recording, or by any information storage or retrieval
system, without the prior written permission of the copyright owner and the publisher.
ISBN-13 (pbk): 978-1-4302-1057-3
ISBN-13 (electronic): 978-1-4302-1058-0
Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1
Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence
of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark
owner, with no intention of infringement of the trademark.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks
of their respective owners.
Lead Editor: Steve Anglin
Technical Reviewer: Jay Kasi
Editorial Board: Clay Andres, Steve Anglin, Ewan Buckingham, Tony Campbell, Gary Cornell, Jonathan
Gennick, Matthew Moodie, Joseph Ottinger, Jeffrey Pepper, Frank Pohlmann, Ben Renow-Clarke,
Dominic Shakeshaft, Matt Wade, Tom Welsh
Project Manager: Richard Dal Porto
Copy Editor: Marilyn Smith
Associate Production Director: Kari Brooks-Copony
Production Editor: Laura Esterman
Compositor/Artist: Kinetic Publishing Services, LLC
Proofreader: Nancy Sixsmith
Indexer: Broccoli Information Management
Cover Designer: Kurt Krames
Manufacturing Director: Tom Debolski
Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor,
New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail , or
visit .
For information on translations, please contact Apress directly at 2855 Telegraph Avenue, Suite 600, Berkeley,
CA 94705. Phone 510-549-5930, fax 510-549-5939, e-mail , or visit .
Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional use.
eBook versions and licenses are also available for most titles. For more information, reference our Special
Bulk Sales–eBook Licensing web page at />The information in this book is distributed on an “as is” basis, without warranty. Although every precaution
has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to
any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly
by the information contained in this work.
The source code for this book is available to readers at .
Contents at a Glance
Foreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
About the Authors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
About the Technical Reviewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi
■CHAPTER
■CHAPTER
■CHAPTER
■CHAPTER
■CHAPTER
■CHAPTER
■CHAPTER
■CHAPTER
■CHAPTER
■CHAPTER
■CHAPTER
■CHAPTER
■CHAPTER
■CHAPTER
■CHAPTER
■CHAPTER
■CHAPTER
■CHAPTER
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Why Use a Service Bus? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Installing and Configuring the Software . . . . . . . . . . . . . . . . . . . . . . . . 15
Creating a Hello World Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Message Flow Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
A Crash Course in WSDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Intermediate Message Flows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Asynchronous Messaging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Service Types and Transports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Advanced Messaging Topics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
Reporting and Monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
SOA Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
Planning Your Service Landscape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
Implementing Your Service Landscape . . . . . . . . . . . . . . . . . . . . . . . . 303
Versioning Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
Performance: Tuning and Best Practices . . . . . . . . . . . . . . . . . . . . . . . 359
Administration, Operations, and Management . . . . . . . . . . . . . . . . . 377
Custom Transports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
How Do I . . . ? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467
■INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485
iii
■INDEX
<service>, 79
<types>
custom data types, 76–77
importing XML schemas, 77–78
minOccurs and maxOccurs, 77
native data types, 76
overview, 75
best practices
avoiding dependency trap, 81–85
document-centric, literal style, 85–87
overview, 80
reference types from XML schema
files, 80–81
definitions, 75
importing from URL, 469
namespaces
default namespace, 73–74
overview, 71–73
target namespace, 74–75
overview, 70–71
reasons to learn, 69
Simple Object Access Protocol (SOAP)
with, 144–145
Simple Object Access Protocol (SOAP)
without, 145–146
support for custom transport,
461–463
visualizing documents from schemas
overview, 87
qualified and unqualified attributes,
91–92
qualified and unqualified elements,
87–91
XML with, 146–150
XML without, 150
WSDL service type, 143
WsdlcTask, Ant, 22
<wsdl:input> element, 259
wsdlLocation attribute, @WebService
annotation, 35
<wsdl:operation> element, 259
WSDL/Policy/MFL/Schema/Proxy,
retrieving via HTTP, 477–478
<wsdl:port> element, 283
<wsdlsoap:binding> section, 35
WS-Policies
custom, 237–238
standards, 232–235
WS-Policy, 233
wsp:Policy element, 260
<wsp:Policy> element, 234
WSRM (Web Services Reliable Messaging),
187–192
applying policy, 189–192
overview, 187
setting up, 187–189
WSRM protocol, 400
WSRM_SB project, 187
WSS (Web Services Security), 228
WSS scenarios, 239–240
WSS SOAP header, 229
wsse:Security header, 236
wsu:Id attribute, 260
■X
xf:helloToGoodbye function, 66
XML, 61
converting into string using XQuery, 481
as messaging type, 163, 166, 172
without WSDL, 150
with WSDL, 146–150
XML manipulation, 367
XML nodes, retrieving namespaces of, 481
XML Schema Document (XSD), 8
XML schemas, 11
importing, 77–78
reference types from, 80–81
XML variables, converting String values
into, 481
XMLBean classes, 405, 417
XMLBean schemas, 405
XmlObject class, 436
XmlObject interface, 423
XMLObject representation, 442
XmlObject Source interface, 441
XmlObjectSource Source interface,
440–441
XmlObject.type attribute, 423
xmlResponse variable, 480
XMLWSDLService proxy service, 147
507
508
■INDEX
XPath, optimizations, 368–370
<XPath> link, 108
XQuery, 61
converting String values into XML
variables using, 481
converting XML into string using, 481
optimizations, 368–370
retrieving SOAP Headers using, 475–476
retrieving version numbers from
namespaces, 481–482
testing for null values, 482
XQuery resource, 252–253
XQuery Transformation tool, 170
XSD files, 288
xsd: prefix, 73
XSLT (eXtensible Stylesheet Language
Transformation), 11
xs:string argument, 65
XXXSource object, 441