Enterprise Service Oriented Architectures
Enterprise Service Oriented Architectures
Enterprise Service Oriented Architectures
JAMES MCGOVERN
OLIVER SIMS
ASHISH JAIN
MARK LITTLE
A C.I.P. Catalogue record for this book is available from the Library of Congress.
ISBN-10
ISBN-13
ISBN-10
ISBN-13
1-4020-3704-X (HB)
978-1-4020-3704-7 (HB)
1-4020-3705-8 (e-book)
978-1-4020-3705-4 (e-book)
Published by Springer,
P.O. Box 17, 3300 AA Dordrecht, The Netherlands.
www.springer.com
Author Team
To those who are savage in the pursuit of excellence
James
To my wife Sherry and sons James and Sylvester who provide and replenish the
energy necessary for me to complete the exciting work as well as the mundane. To
Mom and Dad, thanks for the encouragement and persistence.
Oliver
To my wife, Heather, for just about everything, and to my children Christopher,
Richard, and David, of whom I am inordinately proud, and who have kept me
rmly rooted in reality.
Ashish
To my wife Nishma and children Eshan and Ronit for their love, patience and
support. To my parents, for their encouragement throughout the years.
Mark
Id like to send my love to all my family, particularly my wife Paula and our children
Daniel and Adam, who have acted as an anchor for me through the years, keeping
me sane throughout the storms.
TABLE OF CONTENTS
ENDORSEMENTS
xi
xiii
FOREWORD
xvii
PREFACE
xxi
xxv
ACKNOWLEDGEMENTS
xxxi
xxxiii
1
3
19
3. The Platform
32
4. Transitioning to ESOA
45
5. Summary
48
49
51
2. A Component Denition
55
3. Component Granularity
64
vii
viii
Table of Contents
81
5. Summary
94
CHAPTER 3: ORCHESTRATION
1. Workow and Business Process Management
95
97
101
128
4. Design-Time Demonstration
129
5. Run-Time Demonstration
145
6. Summary
148
151
152
154
3. Programming UDDI
169
4. Internationalization
179
5. Summary
187
189
191
2. Security Concepts
193
3. Security Technologies
196
225
5. WS-Policy
230
6. WS-Trust
231
7. WS-Privacy
232
8. WS-SecureConversation
232
9. WS-Federation
233
Table of Contents
ix
10. WS-Authorization
233
11. Summary
233
235
1. Problem Space
236
2. Systems Management
244
3. Alerting
250
4. Provisioning
252
5. Leasing
253
6. Billing
254
7. Pricing/Chargeback Models
255
8. Lifecycle Management
257
9. Management Architecture
271
277
279
12. Summary
280
CHAPTER 7: TRANSACTIONS
281
281
288
290
291
299
6. Security Implications
312
7. Interoperability Considerations
314
8. Summary
315
Table of Contents
317
1. Overview
319
2. Events
320
3. Agents
323
4. Threads
329
332
338
344
8. Event Notication
347
9. Practical Considerations
352
10. Summary
355
OUTTRO
357
359
1. Distributed Computing
360
2. Practical Considerations
385
3. Summary
385
387
1. System Qualities
387
2. Design vs Run-Time
391
APPENDIX C: REFERENCES
395
403
405
ENDORSEMENTS
You cant live a perfect day without doing something
for someone who will never be able to repay you.
John Wooden
Enterprise SOA is well written and insightful. This book covers enormous ground and
readers will nd it the best, single source on SOA. Highly recommended!
Ron Widitz
Enterprise Architect
Discover Financial
This book was truly a guide for all levels of individuals developing business applications
in todays global, open market. It clearly summarizes key concepts for executive
management, provides the framework of architectural guidelines and standards, as well
as provided detailed coding examples for entry level developers. This book should be
a must read for all interested in leading their organizations business model into the future.
Damon Rothstein
Enterprise Network Architect
Piper Jaffray and Companies
Concise, readable and useful as a tool in the running of a business. You truly pull
concepts together with real world examples.
W.M. Douglas Crawford
VP NASDAQ Technology & Operations
Advest
Enterprise SOA provides architects and developers with an excellent source of much
needed information on understanding how to utilize enterprise technologies such as
xi
xii
Endorsements
SOA, orchestration, components, and registries to solve problems that currently face the
enterprise. Understanding these technologies will help architects develop systems that can
solve current problems as well as lay down an architecture that will adapt to on going
changes in the business environment.
Suneet Shah
CTO and Chief Architect
Diamelle
Enterprise Service-Oriented Architectures provides a unique and worthwhile lifecycleperspective to realizing a SOA. A number of concepts such as components, registries,
web-service security, management, business processes, etc. are addressed in the context of
different stages during the realization of a SOA, including : translating SOA requirements
to design, design to implementation, and implementation to deployment.
Sekhar Sarukkai
Technical Evangelist
Oblix
This book is an outstanding and insightful work on the perspectives and potential of
service-oriented architecture. A must read for every Enterprise Architect who needs to
know how to succeed in the face of architectural challenges presented as part of his/her
daily chores.
Nitin Narayan
CEO
Mavenz, India
This book is the product of some of the leading thinkers in Information Technology
today. The concepts included in this book are being debated and analyzed by most of the
Information Ofcers in the world right now. This book provides a history of how we got
to SOAs, what they mean today, and where they will lead tomorrow. The implications of
SOAs, Web Services, Federation, BPEL, and Grid computing, will revolutionize the IT
industry. We are living in truly interesting times. Those of us in the IT community have
our work cut out for us to lead our companies and customers into the next generation of
computing. Thank you for this great book to help spearhead the charge!
Joe Gibson
Senior Practice Director, Integration
East Area Technology Services
Oracle
The new enterprise requires a new type of leadership based on the logical continuation
of historical effort, while not doing what has been done just because it has been
done that way in the past. Agility and leadership when combined is a cohesive
presentation of common sense mined from the few truly successful projects as
opposed to the aggregation of every (predominately failed) effort declared complete
not only successful projects but projects that really add value to a business imperative.
We are living in a new era where one seeks uncommon approaches while maintaining
common virtues.
The art of leadership is about knowing and inuencing people so that they can come
to share common values resulting in more efciency in achieving the strategic vision
for the enterprise. Leadership must also embrace diversity which will lead to a much
more lively dialectic.
The Enterprise Series has earned its place as a valuable resource to those who want
to ramp up quickly and stay ahead of the curve. The authors of books within this
series are not writers hired to cover the hot topic of the minute. Instead they are
thought leaders and expert practitioners who bring insight to the community at large
based on real-world experience. More importantly, they are not theorists but actually
practice what they preach.
This series is founded on the conviction that enterprises should differentiate
themselves, their architecture and their people based on the way they think as
much as on the products or services they sell. Thought leadership is all about
time-honored expertise and comprehensive capabilities. Its inection point however
is new thinking and original perspectives.
xiii
xiv
We hope you nd this series and this book to be a practical guide and trusted advisor
leading you successfully on your journey.
James McGovern
Rajanish Dass
Anthony Finkelstein
John Gtze
Series Editors
James McGovern
James is an industry thought leader and the co-author of several recent books on
service-oriented architectures, enterprise architectures and technology leadership. He
is employed as an Enterprise Architect for The Hartford Financial Services Group,
Inc. He holds industry certications from Microsoft, Cisco and Sun. James is a
popular speaker at elite technology conferences around the globe. He is member of
the Java Community Process and the Worldwide Institute of Software Architects.
Rajanish Dass
Rajanish is a Fellow at IIM Calcutta and his primary research and teaching interests
are in the area of Information Systems Management and its applications to various
arenas of doing business. Particular interests lie in the area of real-time Data
Mining and Business Intelligence techniques, developing algorithms and heuristics
for performance enhancement, applications of Business Intelligence techniques for
various areas of business like supply chain management, network intrusion detection,
privacy and security enhancement, anti-spamming techniques, retailing, nance and
business policy making, Competitive Intelligence, etc.
A rank holder throughout his career; he has experiences in working for high-ended
projects at the IBM Research Laboratory India and at the Tata Consultancy Services.
He has published a number of research papers in forums of international repute and
of national signicance. He is currently doing research in collaboration with world
renowned research labs of MIT, Oracle Centre of Excellence, Messagelabs, etc.
Anthony Finkelstein
Anthony is Professor of Software Systems Engineering at University College
London. He is a founder of London Software Systems a new joint research
institute established jointly by UCL and Imperial College. He has contributed to
xv
FOREWORD
We live in an interesting (in the sense of the May your life be interesting Chinese
proverb) moment of the IT industry. Finally, many of the disciplines required
to manage IT in a structured and agile way are converging together. We now
have the theoretical concepts and practical experience to align IT to the business,
manage IT as a business, dene enterprise architectures, and align IT initiatives and
individual projects (not only as far as development is concerned, but also with regards
to outsourcing, deployment, integration, governance, and the other IT concerns).
Nearly any imaginable technology IT challenges can currently be solved (or has been
solved) by some company in the industry. Companies willing to invest the time and
money and having the experience (or the luck ) to do it can truly take advantage
of IT to achieve their business objectives. And we have many failures and successes to
learn from, and to build upon.
A key architectural and technology element of this convergence is an architectural
style that became known in the year 2000 as Service-Oriented Architecture. Since
2003, this has started to morph toward an architectural style with the potential
of impacting the vast majority of IT: an Enterprise Service-Oriented Architecture
(ESOA). In its widest meaning, this term indicates the architectural style enabling
an interoperability layer reducing the costs of integration, creating a technical
and functional decoupling between applications, and supporting an enterprise-wide
rationalization of IT applications. When ESOA is fully adopted, enterprises can align
IT to their business processes and create a transitioning path toward a normalized IT
portfolio. As such, an ESOA has the potential to profoundly impact both business
and IT.
It is indeed the rst time in our industry that the IT disciplines, technologies,
approaches are coming together to this extent. And still, IT is today more complex
than ever: addressing IT this way is still beyond the capability of most organizations,
both due to the costs and to the complexity of the task. The industry still needs to
mature to bring costs and complexity down. For this to happen, among other things
xvii
xviii
Foreword
we need to see books addressing the required architectural elements. This is one of
those books.
In 1996, Oliver Sims and I were working together on a large product development
(over 500 hundred developers building an ERP product with thousands of tables).
Oliver introduced a concept he called semantic messages. A semantic message
was a message that contained not only the data that needed to be sent, but also
tags describing the data being sent. For a couple of years, we explored together
the many challenges of addressing interoperability through semantic messages to
address development, interoperability, and deployment in-the-large. We built a
simple language for describing these semantic messages. This was the rst time I had
met the concept of what I later called a strongly-tagged language. We also built
the infrastructure, patterns, architectures, modeling tools and code-generation tools,
repositories, and processes to dene these semantic messages in an architecturally
consistent way. As often happens in our industry, in time I discovered that many
other teams had been working with similar approaches in their companies.
These approaches were not standards, but rather very proprietary approaches. So
when XML came out, many people were happy to nally see a tagged language
that was being standardized and adopted industry-wide: something for which we had
unsuccessfully lobbied in various standard bodies for years. Now nally the industry
had a standard as a basis for what we believed was the best way to address many
interoperability issues.
Of course, XML is just a very basic language, alone it cannot do much: to
achieve its potential, it needed a whole set of additional standards, technologies,
infrastructures, frameworks and tools to cover the whole spectrum of what is needed
for interoperability. Today, this is reected in the many Web Services standards, and
in the many products being sold to support Web Services. But, once these basic
technical layers are addressed, any serious project needs to address, among other
things, the architectural issues. The point is not (and has never been) the technology:
the point is how to use these technologies in the various architectural choices we have
to make to address the requirements.
The industry has come a long way. Many Web Services technology providers have
come and gone. The industry is stabilizing and consolidating. The Open Source
movement has brought costs down. Second-generation architectural approaches
provide maturity models for component blueprints and models enabling faster and
more reliable software manaufacturing. Now we have much experience with Web
Services infrastructures, and, not only in specic companies but industry-wide, we
know what works and what doesnt. For the business, this promises the elimination of
costly, redundant, and proprietary approaches, and the ability to integrate applications
Foreword
xix
quickly and easily. IT is rapidly commoditizing, and ESOA helps drive value higher
and higher up the IT chain.
And nally, we start to see books not treating the problem as a simple standard
or technology problem, not focusing only on the basic Web Services bricks, but
positioning Web Services within the larger architectural perspective. The book you
hold in your hands is a ne example of this.
This book has the advantage of having been written by industry practitioners covering
many perspectives in IT: the authors together have the right mix of technology product
perspective, consultant perspective, and large IT shop perspective. The book covers
many of the most important topics: components, registries, security, management,
transactions, and events. As such, it addresses an important need: bridging the gap
between technology and architecture.
Enterprise Service-Oriented Architectures are one of the most signicant evolutions
in the IT industry in the past few years. They share the spotlight with other significant evolutions and trends. These include the wide-spread adoption of enterprise
architectures, the creation of an enterprise architecture discipline that looks well
beyond software architecture to address the many business, functional, structural
and technical aspects of IT today, the maturity of governance and compliance process
frameworks, and the application of agile concepts to all aspects of IT (including
deployment of packaged software and outsourcing). But software architecture remains
the critical prerequisite for success in IT and in ESOA in particular: this book addresses
this prerequisite.
Thanks, guys, for putting together a ne and timely book.
Peter Herzum
President, Herzum Software
PREFACE
Dont tell people how to do things, tell them what to do
and let them surprise you with their results
George S. Patton
xxii
Preface
Preface
xxiii
The great revolution in our generation is that of human beings, who by changing
the inner attitudes of their minds, can change the outer aspects of their lives.
Marilyn Ferguson
The goal of this book is to share insight gathered by industry thought leaders in a
practical easy to read manner. This book contains many leading edge examples that
illustrate how agile approaches to enterprise architecture can be applied to existing
business and technology issues. It will help one focus on how to think concretely
about enterprise architecture while providing solutions to todays problems.
Within the covers of this book, you will learn about the following topics:
Fundamentals of a Service-Oriented Architecture,
Component-Based Services,
Orchestration,
Registries,
Management,
Transactions,
Event-Driven Architecture, and
Understanding Distributed Computing.
xxv
xxvi
Audience
This book is for every Java and .NET developer and architects of Fortune 1000
enterprises and the consultancies that service them who have the drive to spend extra
hours feverishly seeking bits of wisdom on their craft and who want to gain the latest
insights and strategies for leveraging emerging enterprise SOA disciplines for value
creation, increased business agility and strategic competitive advantage.
This book does assume that one has signicant IT experience under their belt and
have worked on projects that were both large and small; on time as well as those
which are over budget using different project management, software development and
infrastructure paradigms. This book is not for those who desire all the information
they require in a single book as this is an impossible goal to achieve; rather this is best
suited for those who want to gain insight from thought leaders and are willing to be
savage in the leap from good to great.
Finally, this book is aimed at the people who must create applications in the real world
day-in, day-out. Many of the best practices books treat each tip as the sole focus of a
chapter with no discussion of integrating it into a real application. Real applications
are tenuous at best, requiring lots of moving parts in order to function together.
Concepts and recommendations within this book are presented in context of a living
enterprise with all the places that the real world intersects with the academia of the
problem space at hand.
The hardest part of starting an enterprise service-oriented architecture initiative is
knowing where to begin. We hope that our insights will be a useful starting point for
a set of well-managed endeavors for many an architect.
xxvii
xxviii
Disclaimer
The advice, diagrams and recommendations contained within this book may be used
as your heart desires, with the sole discretion that you may not claim that you were
the author. The publisher, authors or their respective employers do not provide any
form of warranty or guarantee its usefulness for any particular purpose.
This book is 100% error free! Not! If you believed us even for a second, I have a
suspension bridge in my backyard that I would like to sell you. The author team and
editors have worked hard to bring you an easy to understand, accurate guide on Enterprise Service-Oriented Architectures. If you nd any mistakes in this book, we would
appreciate your contacting us via email at [email protected].
xxix
This book may use from time to time examples of a ctitious organization. Any example
companies, organizations, products, domain names, email addresses, people, places, events
depicted herein are ctitious. No association with any real company, organization, product,
domain name, email address, person, places or events is intended or should be inferred.
xxx
ACKNOWLEDGEMENTS
When the character of a man is not clear to you, look at his friends.
Japanese Proverb
A book like this is never just the work of those whose names appear on the cover. Like
the academy awards, there are so many people we would like to thank We are
immensely grateful for all those who have encouraged us, provided practical advice,
debated the ner points on controversial topics and whose insights have honed our
own.
The authors have beneted immensely in their own professions by reading papers
from other industry thought leaders including but not limited to (in no particular
order):
Jeff Schneider
Doug Barry
Martin Fowler
Doug Kaye
The author team would also like to thank other writers we have worked with in the
past and desire to work with in the future (in no particular order):
Per Bothner
Jason Gordon
Leeanne Phillips
Sameer Tyagi
Elias Jo
Nitin Narayan
Kurt Cagle
James Linn
Sunil Mathew
Alan Williamson
Scott W. Ambler
Rahul Tyagi
Yakov Fain
Lynn Denoia
Vaidyanathan Nagarajan
Vikas Sharan
Dave Hollander
Kito Mann
Finally, the author team would like to thank our editor, Robbert van Berckelaer, for
allowing our ideas to be published in a manner the community sorely needs and
most importantly our copy editor, Jolanda Karada, for painstakingly copyediting and
ensuring this book is error-free.
xxxi
xxxii
Acknowledgements
James McGovern
Best wishes to the reluctant warriors within the Armed Forces who spread freedom
throughout the planet. Prayers to the families in Palestine, Israel and other parts of
the Middle East who seek peace and those who have lost their lifes in pursuit of it.
To all of my coworkers at The Hartford who have been merciless in the support of
speed, agility and balance in our daily lives. To Democrats, who make thievery and
cowardice sound so romantic. To Republicans, who make Democrats look principled.
Regardless of land, religion or language, there is just but one God. I must thank our
creator whom has bestowed upon me many favors. I am grateful for being blessed
with a great family, doing the things I love and working for such a great employer.
To say that I am not worthy of such blessings is obvious to anyone who knows me,
which makes me all the more grateful.
Oliver Sims
Such insights as I may have developed over the years have been mainly due to the
many valued colleagues with whom I have had the honor of working. In particular,
I would like to thank Martin Anderson, Alan Boother, Roger Brown, Peter Eeles,
David Frankel, Mike Guttman, Peter Herzum, Haim Kilov, Wojtek Kozaczynski,
Maurice Perks, Dave Roberts, Mike Rosen, Trevor Sharpe, Sandy Tyndale-Biscoe,
Rick Williams, and Bryan Wood.
Ashish Jain
I would like to thank all my colleagues at Ping Identity for helping me learn everyday.
In particular, I would like to thank Darren Platt and Brian Whitney for taking the
time to share their real world experiences with me. I would also like to thank my
ex-colleagues at BEA, John Funk and Bob Webster, for reviewing the content and
their invaluable comments.
Mark Little
I would like to thank all of my colleagues at Arjuna Technologies, who have helped
to make it a great working environment over the years. In particular Stuart Wheater,
Barry Hodgson, Dave Ingham, Steve Caughey and the members of the transactions
team, past and present. Many thanks go to Professor Santosh Shrivastava of the
University of Newcastle upon Tyne, who started my career off in this direction and
has been a constant friend over the many years. Thanks to my ex-Bluestone and
Hewlett-Packard friends and colleagues, including Bob Bickel, ex-general manager of
Hewlett-Packard Middleware, Al Smith, Greg Pavlik and Jon Maron, who showed
me that the best things in life are free.
The author team owes a debt of gratitude to all of the reviewers who provided
guidance, feedback, constructive criticism, praise and encouragement throughout
the manuscript writing process. Our reviewers came with diverse backgrounds: from
people who believe in traditional processes to those who have embraced agile methods;
from those whose native tongue is English, to those who speak joyous languages such
as Arabic, Chinese, French, Hindi, Spanish, Urdu and others; from those who are
lowly developers and project managers to those who are senior executives, this book
would not be what it is without you.
The author team deeply appreciates all of the feedback received during the manuscript
writing process from the following individuals (company afliations are included
where permitted):
Argentina
Daniel J. Biondi, Regional CT, EDS Latin America Solution Centres, Buenos Aires
Australia
Shaji Sethu, Solutions Architect, Volante, North Ryde, NSW
Belgium
Fanuel Dewever, Consultant, Human Capital Management, IBM Business
Consulting Services
xxxiii
xxxiv
Canada
Henry Chiu, Architect/Trainer/Mentor, ObjectSoft Solutions, Ontario
Finland
Anders Aspnas, Solution Architect, Fujitsu Services OY
Germany
Stefan Tilkov, Managing Director, innoQ Deutschland GmbH, Ratingen
India
Naveen Gabrani, Software Project Manager, Computer Sciences Corporation
Rohit, S. Gulati, CISA, CSQA, Iex Solutions, Bangalore
Shivprasad Koirala, AG Technologies, Nepal
Pakistan
Ammad Amjad, Systems Architect, Lahore Stock Exchange
Scotland
Jon C. Ferguson, PhD, Director and Architect, Omega Software, Ltd., Aberdeenshire
Singapore
Victor Putra Lesmana, IBM
xxxv
Ukraine
Ruslan Shevchenko, Director, Grad-Soft Ltd., Kiev
United Kingdom
Max Kington, Technical Architect, Cantor Fitzgerald, London
United States
Wayne Allen, Product Development Manager, Corillian, Portland, Oregon
Matt Anderson, Senior Enterprise Architect, Great American Insurance Company,
Ohio
Adolfo Lagomasino, Architect, Lucent Technologies, Landover, Maryland
Barbara McGowin, Principal, McGowin Enterprises, Goose Creek, South Carolina
Robert W. Meriam, Chief Infosec Ofcer, Catholic Health Services of Long Island,
Melville, New York
David L. Nicol, Founder and CTO, TipJar LLC, Kansas City, Missouri
Donna M. Schaeffer, Associate Professor, University of San Francisco, California
Ravi Sharma, Senior Enterprise Architect, Systems Development Factory, General
Motors, Detroit, Michigan
1
UNDERSTANDING
SERVICE-ORIENTED
ARCHITECTURE
Mans mind, once stretched by a new idea, never regains its original dimensions.
Oliver Wendell Holmes
The idea of software modules providing services to other software modules is a longestablished approach to software design. A service has three fundamental attributes:
the services description in the form of an interface denition, a mechanism for
accessing or consuming the service by invoking its interface, and an implementation
or a provision of the service that is, the code behind the interface. Today, this
approach is being revitalized by a new and standard technology Web Services.
In the past, Enterprise Systems have been dogged with a plethora of different kinds
of interface, each tied to a specic technology or commercial product. Project teams
have had to master a whole array of different ways of invoking interfaces of binding
or tying their software to other software often at high levels of technical complexity.
And it is the process of binding software modules or subsystems together that often
presents the greatest development problems. It has been said that plumbing never
leaks in the middle of a pipe: it always leaks at the joints; and so it is with software.
Although there have been a number of approaches to this problem, there has been
a lack of effective standards that apply not only between enterprises but all the way
down to between modules or subsystems co-located on the same machine. Companies
Diagrams in this chapter Copyright Sims Architectures LLP 2005.
on the major architectural concerns that are affected by service orientation. We start
with an introduction to web services in the context of enterprise architecture. The
following chapters address component-based services, service orchestration, service
registries, security, service management, transactions, and event-driven architecture.
We hope that readers will nd how enterprise architecture can be re-vitalized not only
by the introduction of web services technology but also by the way a service-oriented
approach can make a desirable difference to enterprise architecture.
Introduction
This chapter presents the major aspects of a service-oriented architecture for the
enterprise. To be effective, such an architecture must address more than the technical
design of services: it must also provide a design for IT agility in the face of increasing
time-to-market and responsiveness pressures.
Enterprise Service-Oriented Architecture is centered on three major concepts:
Services offered over the web and within the enterprise using XML-based
standards both for the specication of invokeable services and for the message
ows involved in requesting and delivering those services. This is often referred
to as just service-oriented architecture (SOA).
Implementation of services using component-based software engineering
(CBSE) architecture (see Chapter 3), which not only addresses structuring
new applications, but also embraces such aspects as legacy wrapping, workow,
and Business-to-Business (B2B) specications.
An architectural, procedural, and organizational mindset that is service-oriented,
and which can merge the web services technology and CBSE potential into a
synergistic whole that can be hugely productive.
The rst of these concepts is becoming well known. Some services will be provided
by suppliers outside the enterprise. However, most enterprises know that competitive
advantage depends on their core systems and processes. They also think it foolhardy
to cede control of these, and more importantly the valuable in-house business domain
knowledge, to a third party. Hence the core services will continue to be provided
in-house, either though in-house development, outsourcing, or through packages.
It is sometimes thought that SOA means building applications by composing thirdparty services. However, someone somewhere has to build the code that provides
the services. A key question often overlooked is, how are the implementations of
business-oriented services best designed, structured, and built? The second concept
provides the answer to this question, and is addressed separately in Chapter 3.
Underlying these more technical considerations is the pressing need for a major
improvement in exibility and timeliness of systems. The third concept that of a
service-oriented mindset has developed as an important part of the response to this
need.
The chapter is structured into four parts as follows:
Section 1 (Introducing Service-Oriented Architectures) shows how a single architecture based on mature CBSE can address a wide range of capabilities including
Business-to-Business (B2B), Business-to-Customer (B2C), Business-to-Government
(B2G), workow, Business Process Management (BPM), and legacy wrapping, and at
the same time can provide the scalable enterprise services needed. In addition, we show
how a Service-Oriented Architecture can establish better separation between major
enterprise components, and enable inherently more adaptable back end applications.
CBSE itself is addressed separately in Chapter 3.
Section 2 (Service-Based Collaboration) examines how the basic service orientation
concepts can enable effective intra- and inter-enterprise collaboration. The key to
collaboration is federation a concept that enables loosely-coupled but effective
integration through higher-level services. Federation as the basis for collaboration
and integration can enable much more rapid business evolution and responsiveness
than other approaches, such as providing a new packaged or purpose-built application
for each new service requirement, or re-engineering two existing services into a single
combined service implementation that also provides the new higher-level service
required.
Building an Enterprise Service-Oriented Architecture (ESOA) is not easy. It is true
that some impressive immediate gains can be made, but the challenge is to ensure
that those early gains become the foundation of a truly productive and responsive
service-oriented system. Without such a foundation, the danger is that after a few
years all that has been created are yet more rigid and inexible stovepipes serviceoriented legacy! The ESOA that positions you not only for the present but also for
the future rests on a rm architectural basis that delivers:
Separation of technology platforms from the business services offered, and from
the business logic that implements those services.
Flexibility and responsiveness so that the services offered both within and outside
the enterprise can respond fast to the evolution of the business.
Section 3 (The Platform) deals with technology platforms that supports business
services, and, more importantly, its separation from those services. Such separation
is crucial in enabling business services to evolve at the speed of the business, rather
than being constrained by technology change.
Section 4 (Transition) briey discusses a process that can address the key aspects of
a transition to service-orientation. Moving to an agile ESOA environment is not a
simple task. A major inhibitor is the effort and management focus needed to plan
and take the rst steps towards the cohesive holistic environment required. This work
may well include some organizational aspects.
Of course, to be effective, and to truly enable business agility, there must be clear
traceability between business requirements and system implementation. Otherwise
the services provided may well not be those the business requires and needs. What
is needed is to connect business requirements directly with the kind of ESOA
discussed here, The next chapter discusses an approach for providing a near-seamless
progression from business requirements to service implementation.
1. Introducing Service-Oriented
Architectures
First we provide an introduction to Web Services and the place they can play in
enterprise systems. The aim is to provide an overall understanding of the technology
rather than a tutorial on its detailed application. A high-level model of our enterprise
system context is also presented to aid the discussion. Second, we examine the extent
to which web services can be used within an enterprise system, and conclude that they
can. This means that a single worldwide standard for services can be used not only
between enterprises, but also within them, even within a single address space! All parts
of an enterprise system can be provided with the same standard technology, fronting
legacy systems, message buses, new systems, business processes, and workow. Thus
the current Tower of Babel surrounding interface denition and invocation can be
conquered, and a new level of simplication becomes achievable.
(W3C). The specications mainly use XML as their alphabet.1 The reason for their
success over the past few years is that the specications are:
platform-independent,
effectively, a single platform-independent type system,
international standards,
relatively simple,
freely available, and
supportive of loose coupling.
These standards provide a highly effective lingua franca for inter-system communication. The two standards of concern2 for this chapter are at the heart of web services,
and are:
WSDL (Web Services Description Language), and
SOAP (Simple Object Access Protocol).
A third standard, also used in web services, is the Universal Description, Discovery
and Integration registry (UDDI).3 This provides for service publishing and discovery.
Before describing these three standards, let us rst describe our context through a
high-level and much-simplied model of an enterprise system that provides external
web services to other organizations.
The Core Enterprise System is the set of custom applications and bought-in
packages that form the heart of the IT system and that run on distributed servers
and/or mainframes. Security and scalability are of major importance here. The
Core Enterprise System is protected by rewalls and other security mechanisms.
The code that implements the core business logic behind web services, and also
manages core data assets, is here.
The Web Services Integration Broker is the set of middleware responsible for
handling B2B and B2G interactions with external systems.4 This includes storage
of the collaboration specications and their execution, and also invocation of
services provided by the Core Enterprise System.
Web/Application Servers handle user and B2C requests from browsers, both
within the enterprise and outside. User sessions, often long-running, are also
managed here. The sessions make requests for services to the Core Enterprise
System. For scalability reasons, these requests are typically one-shot requests,
such as update order or get stock details.
A Process Engine manages automated business processes and workows, and
is also responsible for storage of specications and their execution. There may
be more than one process engine. For workow, such engines typically provide
a user interface so that users can see and manipulate their work list, and so
that the work items can be managed. A process engine that addresses EAI will
often provide numerous adapters for a range of packaged applications, while a
Business Process Management engine may well provide complex peer-to-peer
protocols for collaborations with third parties systems.
User Systems are typically PCs on users desks, and are included here for
completeness. Some user systems access the core enterprise system directly using
a client/server style of interaction.
The typical interactions between these parts of the IT environment are shown by the
dotted arrows.
Now let us look in more detail at the technology of web services WSDL, SOAP,
and UDDI.
4 For an excellent white paper on the internals of this, see Cummins (2002). Broker function is
If the interface were written using CORBA IDL,6 the order placement function
might look like this:
interface Ordering {
void placeOrder(in string CustNum, in string ProdNum, out
short PONum);
...
};
However, in the web service world, the interaction is described using WSDL (often
pronounced wizdle by practitioners), and the WSDL le is stored by the enterprises
Web Services Integration Broker.7 A simplied version of the WSDL corresponding
to the preceding interface denition is as follows:8
WSDL fragment for an Ordering Service
<definitions name="OrderingService"
<!-- Message definitions including parameters -->
<message name="placeOrderRequest>
<part name="custNum" type="string"/>
<part name="prodNum" type="string"/>
</message>
<message name="placeOrderResponse">
<part name="PONum" type="int"/>
</message>
<!-- PortTypes referring to message definitions -->
<portType name="OrderingPort">
<operation name="placeOrder">
<input message="placeOrderRequest"/>
6 CORBA is the OMGs Common Object Request Broker Architecture. IDL stands for Interface
Denition Language.
7 This repository is indexed using another web standard, UDDI (Universal Description, Discovery
and Integration), whereby the service dened in the WSDL le can be found when potential users of
the service do not know its web location. In our example, we assume the location is known, and so
UDDI is not used.
8 WSDL examples in this chapter are based on WSDL version 1. At the time of writing, version 2 is
in preparation. Version 2 introduces new terminology and a different approach to packaging the various
elements of a service denition. However, the overall discussion here will not be materially affected by
the new version.
10
</definitions>
The purpose here is not to provide a full explanation of WSDL, but merely to
illustrate the kind of thing it is. Note, however, that the placeOrder service is
handled by two separate messages one incoming from the external system to
the system providing the service (placeOrderRequest, and one outgoing from the
service provider to the requesting external system (placeOrderResponse).
The WSDL le constitutes a denition of the service provided at run-time. This
includes the services location (the URI to invoke the service), and the input and
output messages (if any) that will ow in a service execution as SOAP messages. In this
way, WSDL abstracts access to the underlying application data and processes there
is no specication whatsoever of the service implementation itself. The link with the
service implementation is specied, in the service-providing system, quite separately
from the WSDL service denition. Thus there is an absolute separation between the
interface (the service denition) and its implementation.This is a crucial aspect of
Web Services: not only are interface and implementation logically separated, but they
are also physically separated. It is precisely this that enables WSDL interfaces to be
provided for a very wide variety of service implementations, from Java on an app
server to COBOL on a mainframe all accessible from a huge variety of clients. And
it is largely this that make WSDL such an effective universal standard.
11
The (simplied) SOAP messages that ow across the wire during a service execution
could look something like this:
SOAP messages on the wire
<!-- Sent by client to request the service: -->
<Envelope>
<Body>
<placeOrderRequest>
<custNum>AB123</custNum>
<ProdNum>XY-238/5<ProdNum>
</placeOrderRequest>
</Body>
</Envelope>
<!-- Received back from server (response): -->
<Envelope>
<Body>
<placeOrderResponse>
<PONum>845273</PONum>
</placeOrderResponse>
</Body>
</Envelope>
A system that requests a service typically does so through some application that
sends the appropriate SOAP message. Creation of the application code that does
the mapping of (say) Java objects to SOAP messages, and the actual invocation, is
handled by tools. This code is often called a proxy the code that represents in the
client the actual service implementation in the service-providing system.
Just as tools generate proxy code at the requesting end or consumer end-point,
so the code that invokes the implementation of the service at the service provider
endpoint can also be generated. This code receives SOAP messages and maps them (in
various ways according to the particular web services integration broker middleware)
to the native language (e.g., Java) code that implements the service. Responses follow
the reverse path.
But how are services found? In a world of ubiquitous services, there has to be a
standard way for nding services that can be used. The UDDI standard (Universal
Description, Discovery and Integration) provides the basis for this.
12
1.1.3. UDDI
UDDI (Universal Description, Discovery and Integration) is a standard for registering
and searching web services within directories yellow pages as it were containing
web services. UDDI is comprehensively addressed in the Registries Chapter, and
only a brief overview is provided here. UDDIs main function is to provide for the
discovery of services. First, a service provider uses UDDI to store the who, what,
where, and how of a service that is, the publisher, service description, location of
the service, and the interfaces to access the service. Using these elements (as well
as registry-specic service categorizations) potential consumers of web services can
search for services. Then a potential consumer can use UDDI to locate an appropriate
service. This can be done by a human using a browser, or programmatically. Generally,
design-time discovery of services is a manual process performed through a browser. A
consumer of a service will iron out with the publisher details such as the suitability
of the service (does it meet enterprise requirements for availability, disaster recovery),
and register to use the service if authentication is required. Finally, the consumer can
connect to and use (interact with) the service. SOAP is used for messaging (with
other messaging standards also being allowed for).
An additional strength of UDDI is run-time binding. Web service clients should
be designed to cache the endpoint of the web service they access. Should a
communications failure occur, the client should query UDDI and retrieve the
endpoint for the service. It may well turn out that the reason for the failure is that
the URL of the service has changed, and hence the service access can be re-tried. In
this way, web service providers can move their web services (for example to perform
routine hardware maintenance, failover within a cluster architecture, or disaster
recovery) while minimizing impact on consumers.
The UDDI standard denes interfaces to a directory that are themselves web services
described by a WSDL. Web page interfaces to UDDI execute those UDDI web
services based upon human input through the browser, and display the results of
those web services.9
Although there is some provision made within the UDDI standard for some limited
semantics to describe a service, within the context of an enterprise UDDI is probably
likely to be used by humans to browse for services. In other words, it may turn out
to be more useful as a repository of services available than as an automated discovery
facility.
9 Examining UDDIs API documentation, schema and WSDL can serve as an introduction to more
complex web services and their use. For example, see http://www.oasis-open.org/committees/uddispec/doc/tcspecs.htm#uddiv2. See also http://uddi.org/.
13
Having introduced the technical elements of web services, we now examine how a
developer would use them. Again, the intent is to provide an overview rather than a
tutorial.
14
3. When the application runs, it calls the proxy, which does everything necessary to
map the native language request made to it to SOAP requests that go across the
wire to access the service.
4. When a request is received by the enterprises Web Services Integration Broker, it
is mapped to a specic service provider (the implementation of the service the
thing that provides it) in the core IT system. This could be a legacy application,
an EJB, or some other application. Once serviced, a response is sent to the
Integration Broker (not shown in the diagram).
5. A SOAP response is sent back to the requesting system.
With proxies and adapters in mind, our picture of enterprise IT is now as shown
in Figure 3. The adapter effectively provides the route between the incoming SOAP
message and the service provider. The WS Broker and the service provider together
make up the service. But Enterprise SOA (ESOA) is not only about the design
of the service interfaces and the use of web standards such as SOAP and WSDL.
It is not only about the internal structure of the Web Service Integration Broker
(not discussed in this chapter). ESOA is also about the design and structure of the
internals of the service, and the extent to which service orientation using web services
technology can be usefully applied elsewhere within the enterprise IT system.
15
16
17
the time being, we assume that web services have CBSE-based implementations which
access the appropriate corporate resource. This assumption also addresses granularity
and dependency management issues for modules that implement a service.
18
19
2. Service-Based Collaboration
through Federation
The ability to have services collaborate to provide new services is an important part of
Enterprise Service-Oriented Architecture (ESOA). Without this, the various services
are islands silos tomorrows legacy. In order to achieve service-based collaboration,
our ESOA must address how services are federated such that they deliver the
collaborations required. A collaboration can then be said to be achieved through a
federation of services.
2.1. A Federation Is
Federal/federating/federation pertaining to a system of government in which several
States form a unity but remain independent in internal affairs; an association of
largely independent units. (COD 1982)
But what, in our context, are the units being associated? Answer: services. We
are talking about federations of services. Federation is therefore about creating an
environment where common services are made available for use in conjunction with
others.12
Let us start with a typical situation faced by many enterprises today. Figure 6 shows
three legacy systems (X, Y, and Z) that have been given a service interface (the
gray [blue in e-book version] lollipops) through wrappers, which could use EAI
technology. The term service interface refers to a programmatic interface whose
description conforms to the WSDL standard, as described previously in Section 1
of this chapter. The wrapper is implemented using the approaches described in the
same section.
Now assume the enterprise wishes to deploy a service that is a combination of the
existing services. It can do so by dening a business process (using one of the many
tools on the market) that rstly provides a service interface, and secondly is largely
implemented through invocation of the existing services provided by the legacy
systems. Process A in Figure 6 gives an example of this approach. And what we have
here is a federation: Services provided by applications X and Y are federated by
Process A to provide a new service.
12 If services are federated, this must imply that service providers are also federated. Federation of
providers can be implicit or explicit, and there is a range of governance issues that may apply such
federations. However, in this chapter we do not address these issues.
20
21
22
What is a Service?
We have referred to services, service interfaces, and service implementation.
Figure 7 shows a simplied UML13 model of these concepts (cardinalities have been
omitted, since they are quite complex, and the model is, we believe, sufcient for
current purposes without them). The topmost class is the concept of a service instance.
This consists of a service interface, through which the service is programmatically
invoked or requested at run-time, and a service implementation, which is the
code that implements and provides the service. The lower three classes are the
development-time denitions and specications that, when put into production in
the run-time, offer and provide a given service.14
Federation means that a service implementation may be nothing more than an
invocation of another lower-level service, although federation will normally involve
at least a minimal amount of business logic and/or data mapping. Such a service is
often referred to as a choreography, since it causes the underlying services to dance,
as it were, to the tune of the federating service. However, in addition to choreography,
and unless the federation is entirely within the IT facilities of a single enterprise, there
will also be important additional issues such as security, data model semantics, and
trust.
UML version 2 is nearing nalization at the time of writing (see OMG3 2004).
14 In those cases where services are dynamically bound based on run-time discovery, then the interface
denition is a run-time artifact for the service consumer as well as a development-time artifact for the
service provider.
23
components. One professor recently said to me that CBSE is dead, and service-orientation is the new
thing, and applications will be built simply by invoking appropriate services, regardless of where these
are or who implemented them. He seemed to have forgotten that a service must be implemented by
something somewhere, else it is like a chain letter!
24
25
26
These two systems could well be deployed, as shown in Figure 10. Hence these
components must be designed such that they provide services to any appropriate
requestor or consumer. A key part of this approach is rstly that the components
map to business elements as dened (or better discovered) in the requirements phase
of development, and secondly that each component is highly service-oriented such
that they can collaborate with others in providing business solutions. Thus in the
evolution of mature CBSE, there has been a shift from reuse of components as
pluggable modules of software technology to business-oriented reuse and business
collaboration of business services the components themselves being the service
implementations.16
27
28
and workow. However, this categorization is partly driven by the past evolution of tools. Tools in
this area tend to implement various developing standards such as BPML (Business Process Modeling
Language) and BPEL4WS (Business Process Execution Language for Web Services). These standards
are currently in considerable ux, and it is not yet evident which will win out in the longer term. The
tools and middleware that enables business processes to be specied, and provides for their execution,
29
30
31
federates several core process services, one of them being Order Manager,
which in turn
federates several core entity services.
32
each subsidiary, division, region, location, and even each department has its core
competence published as a service.
But we cannot just build each service implementation as a new stovepipe. We need
to bring different services together as and when required, without touching the
implementation of those services. The process of doing this is called federation.
This section has shown, based on concepts developed in earlier sections, how
services that are federations, and how federations of services, can be achieved. But
achieving service federations alone is not sufcient. We also need to change and
evolve them and introduce new services without being tied by the underlying
technology. Thus we must consider how to separate the business-level services and
service implementations from their underlying technology base. We need to provide
a platform that appears to business developers as substantially more stable and unied
than before, while retaining our ability to evolve the many underlying technologies
at their natural pace. Thus we need to consider the platform that supports an ESOA.
3. The Platform
ESOA is quintessentially about satisfying enterprise business requirements in a
responsive and efcient way. A major inhibitor to this is that the business changes and
evolves at a quite different rate than the rate of change in underlying software and
hardware technology. Why is this an inhibitor? Because most current approaches to
application software development fail to separate business logic needed to implement
services from the platform that is, the set of DBMSs, application servers, GUI
infrastructures, BPM engines, messaging systems, communications stacks, system
services such as logging, conguration, naming, etc., that underlie the business
services, and upon which they run.
Look at any business-level application code today, and the chances are you will nd
all sorts of technology code buried inextricably with the business logic, from GUIdriving code to thread and transaction management code. This means that changes
to business function can drag in technology concerns, and changes to technology
impact business logic. And this is not some minor techie problem. It means is that
every time the business needs something to change, or needs some new function,
the business logic developers are immediately immersed in software technology, and
vice-versa. Figure 14 illustrates the effect: not only do both business and technology
changes result in modications to the IT systems, but also each change is one of both
business and technology, thus doubling the effect of each change! By the way, this
applies to new function too, not just changes. And what if we need to move to a new
33
34
can all share the same structure, and where the relationships between the parts of the
structure are very similar, then we have what might be called an architectural style
(Hubert 2002). Much the same concept is also called a product line (Clements and
Northrop 2002), or part of an approach (Herzum and Sims 2000). An architectural
style can be expressed through what is sometimes called a blueprint (also called
a metamodel). Such a blueprint becomes the expression of the architecture in
ESOA. It is a detailed design for:
The structure of the modules to be dened and built by business developers
(including their dependencies and statefulness), how they relate to each other,
where the services are offered, and to whom (internal, external, etc.).
The transparencies enjoyed by business developers that is, the extent to which
software technology is hidden from them.
A specication of how extra-functional challenges such as scalability, buildability,
performance, etc. will be addressed.
One part of such a blueprint is the model of what a component is (see Chapter 2).
A further example of what the blueprint addresses is the distribution part of
a distributed system that is, the logical distribution tiers. These are areas of
responsibility or aspects of business logic as seen by the business developer. They
are separate from, but mappable to, the physical distributed system. For reasons
beyond the scope of this chapter, we prefer a four-tier model to the often-used
three-tier model. Briey, the tiers are:
User the specication of the user interaction with some device (including
screen layouts).
Workspace the business logic involved with managing a users session. This
tier provides services to the user tier.
Enterprise the business logic involved in providing enterprise-level services to
authorized requestors, and also the business logic inherent in business objects
the business-level resources that business processes depend upon. This tier
provides services to the workspace tier, and also to other areas such as B2B
collaborations
Resource the business logic required to access resources such as data (or
printing). This tier provides resource services to the enterprise tier.
Figure 15 illustrates these four logical tiers, and shows how they can be mapped to a
variety of physical systems.
35
36
The key to separation is to dene a virtual platform for business developers that
is deterministically mappable to a number of real platforms. Figure 16 illustrates
this. Note the additional blueprints (designs) for the virtual platform and for the
real platforms. For example, components built according to the business service
blueprint could be mapped or transformed to J2EE or a CORBA Component
Model (CCM) implementation or .NET, all of which support the component
concept. It can also be mapped to some transaction processors such as IBMs CICS.
The mapping or transformation (or partial transformation) would produce business
service components that are of the specic form supported by the target platform.
37
However, the blueprints generally only exist in the minds for the glue providers, and
are often lost when the project ends. Figure 16 suggests that this process, so common
in so many projects across the industry, should be formalized and applied explicitly
within the enterprise so that they are not lost and re-invented project by project.
Section 4 presents a process whereby this problem can be xed.
38
DBMS;
Caching mechanisms.
And for each of these, there are a number of sub-functions needed for example,
effective transaction processing needs thread and connection pooling, and event
management needs queuing.
The development platform includes such things as web service denition tools,
compilers, repositories, GUI design tools, and modeling tools. Again, sub-functions
are needed, such as the ability to interchange artifacts among the various tools.
The overall problem is that, although everything required is available, it is not
available in a single integrated product. This results in high levels of complication
across the whole development environment. From the CIO/Chief Architects view,
all you can buy from vendors today are big construction kits, where you often have to
make up your own assembly and operation instructions. There are lots of specs and
instructions for the individual parts, and much advice on sub-assemblies assuming
you understand all the parts. The main areas of complexity are:
Technical complications throughout the development environment. Addressing
these requires high levels of scarce skill for many development projects. The
result is low effective skill levels applied to many developments, with the
inevitable poor quality and re-work.
Rapid change in and evolution of software technologies. This results in high
levels of technology churn, and a disinclination to install new or upgraded
products. When technology is changed, this has a severe knock-on effect on
the business function portfolio. This is exacerbated by business evolution and
change (naturally) being out of sync with technology change.
Lack of focus on an ESOA architectural style.
Thus we have a situation where a great deal of work is needed to turn the collection
of products into an effective ESOA platform.
39
higher-level than that provided by the general-purpose COTS products. There are
some indications that this may just may be changing. But do not hold your breath
for the next two years.
40
41
things that are needed can be pre-dened, and a great deal of software technology
can be hidden much more effectively.
42
43
44
point solution. Our experience in this area has taught us that a holistic system-wide
approach is required to integrate this effectively into an overall system where data
shown on user interfaces is obtained from a large shared database. For example,
consider a user getting a partial list of entities (e.g. Customers) from the enterprise
database, and double-clicking on one item in the list to open a window showing
that customers details. The function involved in this can be generalized to cover any
entity, so that all the developer has to do for a given entity type is to specify the
display format of the list, and of the panel where details will be shown.
22 The book Business Component Factory (Herzum and Sims 2000) was based on an early proprietary
45
4. Transitioning to ESOA
The previous sections have discussed the nature of web services, scaling up to
federations or collaborations of services, and separation of business from platform
concerns. While all of these are necessary for truly effective ESOA implementation,
by themselves none are sufcient. Applied together, they are mutually supportive and
highly synergistic. However, making them so is not just a matter of throwing them all
into the ring and hoping that something good will emerge. Rather it needs a focused
process to weld them together, and an organization that supports their application
rather than hinders it. Indeed, experience suggests that the greatest inhibitor to
effective ESOA implementation is lack of an appropriate organizational structure.
A big bang approach is almost certain to fail. This leaves evolution and so we need
an evolution process aimed at enabling the IT organization to make the journey or
transition to the desired goal. This section rst discusses the goal of ESOA, and also
ways of articulating the vision at the start of a transition towards the goal. Second,
we briey discuss how moving to ESOA involves organizational changes, so that the
core concepts are supported by the organizational structure rather than inhibited by
them. A process for achieving the transition can usefully follow the general approach
described by Guttman and Matthews (1998/1999); further description of such a
process is outside of the scope of this book.
46
Taking this as a model, the rst thing to do is to articulate the vision of the desired
end state. This includes:
The core architectural concepts, which together dene the technical vision.
Separation of concerns along product line principles (Clements and Northrop
2002), to produce an ESOA Productivity Platform (EPP).
There are several ways to articulate the vision, including a PowerPoint presentation
with accompanying text, and a scenario of what things will be like for developers
and project managers (an example is provided later in this section). In addition a
target programmers model is also highly useful. This is typically dened early in
the transition process, and comprises target component code and target development
procedures. The target code is the code involved in a sample service implementation,
written with an eye to eliminating as much software technology as possible. The code
is annotated to identify how things work, and what facilities will be required of the
EPP to enable this code to run. The target developer procedures should be written
with an eye to eliminating as much work as possible from the development process
itself. This will typically assume integrated tools and an effective repository, thereby
identifying further function required in the EPP.
47
48
5. Summary
We started this chapter discussing web services, which can provide an international
technology standard for enterprise IT. Accessible not only from outside the enterprise,
this technology is also widely usable internally even within the same address space
on a single machine. So now all interfacing problems are solved? Well, no. Web
services provide the potential for a single software interfacing standard throughout
enterprise IT. But the realization of that potential must be consciously designed or
architected.
This chapter has outlined the major aspects of such an enterprise architecture based
on service orientation. Starting with the nature of the web services technology, we
have indicated how it can be applied systemically across the enterprise, how services
can be federated, and how business logic can be separated from underlying platform
technology. And we have briey discussed how a project or program to evolve to an
ESOA can be planned. In the next chapter, we look at the implementation of services,
and also discuss an approach to lessening the divide between business requirements
and the IT systems that deliver solutions to meet them.
2
COMPONENT-BASED
SERVICES
Recently, someone (who should have known better) said of service-oriented architecture, SOA means that we dont have to build applications any more all we have
to do is invoke other peoples services. Thus a service implementation is merely a
collection of service invocations, and the services invoked are implemented by other
service invocations, and so on ad innitum. Like a successful pyramid or chain letter
scheme. Would that it were so easy!
The concept of a service can be usefully seen as comprising three parts:
Service denition dened by a service provider, and seen by a service consumer.
Service implementation code that, when executed, performs the business logic
required to provide the service. (The term code is intended to cover not
only application code but also specications or denitions that are interpreted
by an engine as occurs with Enterprise Application Integration (EAI), or
Workow, or Business Process Management (BPM) products.)
Service execution an instance of a service being provided and consumed at
run-time.
Diagrams in this chapter Copyright Sims Architectures LLP 2005.
49
50
The idea that SOA can work without a service implementation is absurd. Clearly
there has to be an implementation somewhere.
Chapter 1 dealt primarily with the service denition and execution. This chapter
addresses the implementation of a service. The implementation may well consist of
a choreography of other services, and they themselves may be implemented by yet
further services. Thus there can be a chain of subsidiary services involved in the
implementation of some top level service.1 Wherever in this chain there is some
business logic, then someone somewhere must dene and implement that logic. This
applies not only to process denitions that are interpreted by a BPM (Business Process
Management)2 or an EAI (Enterprise Application Integration) infrastructure, but
also to code written by application developers. In the latter case, as well as dening
the business logic, someone must also decide how to structure the software that
implements the service.
In the past, poor design structure has resulted in monolithic and opaque code that
has been costly to evolve, and where traceability of business requirements is lost. In
implementing services, it is essential to avoid creating tomorrows legacy. This chapter
proposes that services are best implemented through component-based software
engineering (CBSE).3 CBSE is much more than merely using component container
middleware. It is a design discipline whose core focus is modularization based on
the natural modularization of the problem domain. It is also a design discipline
that not only includes the best of previous software structuring practice, but also
allows for crucial architectural concerns such as granularity, distribution, exibility,
and rigorous dependency management to be addressed in a coherent way. A design
discipline such as this is an essential pre-requisite for development agility, applying
as much to out-sourced work as to in-house. Finally, we shall see how a unied
component concept cannot only address code structure, but can also encompass
BPM and EAI denitions.
The chapter is structured as follows:
First, the nature of mature CBSE is described.
1 In this chapter, we ignore the possibility, which could at least theoretically eventuate in an open
51
Second, we dene what is meant by the word component, building upon the
UML version 2.0 denition (OMG3 2004), which is very different from that
of previous UML versions.
Third, we consider the major architectural concerns inherent in mature CBSE,
and suggest by brief examples how these concerns can be addressed in a way
that exploits and expands CBSE.
Finally, to be effective, and to truly enable business agility, there must be
clear traceability between business requirements and system implementation.
Otherwise the services provided may well not be those that the business requires
and needs. Section 4 discusses an approach that can deliver a seamless progression
from a business requirements denition to service implementation with little
information loss.
1. Component-Based Software
Engineering (CBSE)
There has been much market hype about components being things bought from
third-party suppliers, so that application development becomes merely the assembly of
third-party components. However, given the almost complete lack of interfacing and
composition standards, together with the lack of denition about what a component
was and what it was not such hype was never very likely to bear fruit, and
indeed in the enterprise application area it has not (although there are some useful
technology-level components, mostly in the GUI area).
Components were also seen by many as being a technology thing (COM, EJB,
CORBA Component Model), where key technical characteristics have been tight
coupling (generally static) of low-level programmatic interfaces and synchronous
RPC-style messaging. This contrasts with the dynamic binding (loose coupling)
provided by such technologies as SOAP and WSDL, with their ability to invoke
services across different technology platforms, and support for several interaction
styles from RPC to asynchronous loosely coupled collaborations. (However, as
we shall see in section 2.3 Network-Style Interfaces, thinking of components as
merely tightly-coupled technology artifacts and hence inappropriate for SOA is to
dramatically miss the point!)
52
In short, CBSE has come to be seen as yesterdays hype, with little to show for it other
than some useful technology. However, if ever there was a case of the baby being
thrown out with the bathwater, this is it!
53
54
and independently pluggable into a system. But such pluggability needs something
to plug into a software socket provided by the middleware platform.
But which platform? Here we are not talking about the technology platform (J2EE,
.NET, CICS, etc.) but rather the virtual platform described in Section 3.1 of the
previous chapter. There is no point in building a component if a large part of that
component consists of bits and pieces of technology code. All that does is to increase
the surface area of the component increases the complexity of the plug that is
a necessary part of each component, and which plugs into the socket provided by
the virtual platform. A major reason why component technology platforms do not
deliver the goods as far as truly pluggable components are concerned is that they leave
far too many aspects to be handled by the developer of the component. For example,
such things as transactions, concurrency, activation, and access to platform services
such as logging, error management, publish/subscribe, and so forth.
But, one might argue, all such code can be generated, especially with the growing
availability of tools implementing the various avors of model-driven development
(for example, implementations of OMGs MDA, Microsofts Domain-Specic
Language (DSL) initiative, IBMs EMF, to say nothing of the many modeling
tools available today that provide for code generation). However, there are problems
with code generation. First, technology code generated for one component (for
example code providing for transactional behavior) may conict with code generated
for another, which means that these two components often cannot co-exist within
a given system. So much for pluggability and interoperability! We need platforms
that provide high levels of technology services, plus a standard policy conguration
approach, where each component is, on deployment, congured for a dened policy.
Second, the more code generated, the more must be re-tested and re-deployed when
something in that code changes. If all components contain signicant fragments
of platform-related (non-business) code, then changes to the platform can result in
massive re-generation, re-testing, and re-deployment.
All these points lead to a clear conclusion that raising the level of the platform
to as high a level of abstraction as possible is much more than a nice-to-have: it
is a necessity. Part of that high level of abstraction will be interfaces to platform
services that allow for exibility as those interfaces evolve which they will. The
key is to slow down the rate of impact on the business-level components. These
too are evolving as the business changes. An effective virtual platform will help a
great deal with this. Instead of both technology and business changes impacting
55
business-level components, in the main only business changes will impact them.
Technology changes will affect mainly the virtual platform.
Components, then, are objects writ large, with appropriate middleware to support
them. Components realize much of the original vision of object orientation.
Components are language-neutral and can be written using either OO or procedural
languages.7 Components are also coupling-agnostic; that is, they may be tightly or
loosely coupled.
But wait a minute consider a system such as supply chain management. A count
of the software repository would show thousands more probably tens of thousands
of OO classes. Does that mean tens of thousands of components? Well, no. As
indicated previously, a component is normally a collection of classes. An important
CBSE concern is dening which classes belong to which component (remember that
a component is not only a deployable module, it is also seen as a big class in its
own right). So, for example, a Sales Order component could consist of an Order
Header class, an Order Line class, a collection class (an instance of which would hold
the Order Line instances), and several smaller classes such as Currency, Order Value
Calculator, etc. CBSE is also concerned with identifying and scoping the components
in a system. So our supply chain management system could end up with perhaps
300500 components, each consisting of a number of classes.
Let us now dene what a component is in more detail.
2. A Component Denition
What is a component? There have been many descriptions and denitions of
component. A useful summary of various aspects, including component vs. class,
and component as a type or as an instance, can be found in Atkinson et al. (2002).
Over the past several years, there has been a developing consensus as to what a
component is, culminating in the OMGs UML2 denition (OMG3 2004). This is
quite different from that given in UML1, and Section 2.1 reviews the new denition.
However, the OMGs denition deliberately applies to many different kinds of
component, including low-level technology components such as GUI components.
For ESOA, it is useful to rene the OMGs denition, and a denition of an
7 Although not available today, probably due to the justied lack of interest in procedural languages,
in the mid-90s there was middleware available that supported mixing components each written in a
different language all in the same address space.
56
57
A component, then, is a kind of class. However, this is not the class you would
use in normal modeling. It is a special kind of class, dened by UML2, and whose
properties include:8
Ability to have an internal structure and ports (a port is a distinct interaction
point both externally with the environment, and also internally to internal
parts).
May be designated as having its own thread of control, or of executing within
the context of something else.
May specify which signals (such as events) can be handled
Behavior that can be fully or partly described by the collaboration of owned or
referenced classiers. (A classier is essentially an abstract supertype within
UML that is a type, that denes a classication of instances (a set of instances
that have features in common), that can include features of various sorts, and
that can be sub-typed.)
Based on this supertype, UML 2.0 denes a component as follows:
A component represents a modular part of a system that encapsulates its contents and
whose manifestation is replaceable within its environment. A component denes its
behavior in terms of provided and required interfaces. As such, a component serves
as a type, whose conformance is dened by these provided and required interfaces
(encompassing both their static as well as dynamic semantics). One component may
therefore be substituted by another only if the two are type conformant. Larger pieces
of a systems functionality may be assembled by re-using components as parts in
an encompassing component or assembly of components, and wiring together their
required and provided interfaces.
A component is modeled throughout the development lifecycle and successively rened
into deployment and run-time. A component may be manifest by one or more
artifacts, and in turn, that artifact may be deployed to its execution environment.
A deployment specication may dene values that parameterize the components
execution.
Note that the realization of a component can include other components. This allows
for various granularity strategies to be applied. In addition, it is expected that a
component that does not include other components will be realized by a number
of classiers, and a good example of a classier is a class. An example of realization
specications are shown in Figure 3, which is a modication of an example in OMG3
(2004) and illustrates a wiring diagram of components. This is a new kind of
diagram introduced in UML2.
8 For full details, see Section 8 Components of OMG1 (2003).
58
59
etc. This means that the services provided by each component should have a dened
scope of visibility within the enterprise as well as outside.
Figure 3 also shows another realization that of Order. Four classes are shown
is realizing Order: Order, OrderHeader, LineItem, and Collection. Order has the
UML-provided stereotype focus, showing that the Order class provides the Order
component with its essential type. Other classes are auxiliary (this stereotype is also
provided by UML) and show that they play the role of the supporting cast as it were
within the component, assisting the Order class to fulll its role as the focus within
the component.
In this way, the dichotomy of type is resolved. In a business information model,
one may well expect to see the classes Order, OrderLine, possibly OrderHeader, and
also many others such as Customer, Address, etc. Domain experts will assert that
there is a concept Order that has within it the concepts of Order Header and Line
Item. But there is also the concept Order that both provides business logic and also
choreographs the other classes involved. So we have Order as a group that ignores
any internal arrangement and choreography of classes, and we also have Order as the
choreographer and holder of some of the business logic. This is the dichotomy. UML
provides for (and so resolves design difculties associated with) this dichotomy. The
component model element (a type) is used to represent the concept Order, and the
component realization is used to show the choreographing Order class and also the
other classes involved without which Order would not be an Order!
Finally note that there is nothing visible in the diagram to show whether Store
physically composes the other three components. Typically, components are not
physically composed; rather Store refers to them.
Now let us return to SOA. The key aspects of the UML2 component that are really
useful for service-oriented architecture are that it:
Is a type;
Can be visible and tangible throughout the development lifecycle and also in
the run-time;
Can be built and deployed autonomously (an example of autonomous
deployment is updating a system with a new version of the component);
and
Is intended to be combined and composed with other components with which
it collaborates to deliver solutions.
60
The UML2 component goes far in providing what is needed for service implementation. Based on the UML2 component, we can dene an Enterprise component
the kind used in building enterprise-strength service-oriented systems.
such as systems management and monitoring. These are not considered further here.
10 With such a virtual platform, the design of an Enterprise Component may ignore a whole host
of technology factors such as transactions, event management, conguration, activation/passivation,
systems management, and provision of any required technology-oriented interfaces. Late in the
development cycle, the code required for implementation of technology bindings, and also of policies,
can be generated or merged (perhaps using aspect-oriented weaving techniques) into the component.
61
supporting this and other transparencies has existed in the past,11 providing
this transparency today requires glue to be added to the available middleware.
This capability can be implemented in proxies that are typically generated.
The underlying invocation will be a Web Service invocation as described in
Section 3.3 of the preceding chapter.
A component also has an internal implementation or realization. This realization
appears both at design time and at build-time. The detailed realization of a component
can vary widely in nature. However, it is useful to distinguish between two main
forms:
1. A programmed realization that is, the internals are coded using a programming
language such as Java or C# (or even a procedural language such as COBOL
in some circumstances!), or by an interpreted language such as Python. The
number of classes in a component implementation typically varies from around
ve to as many as one hundred and twenty or so. An example of a programmed
component is a server-side component implemented with EJB technology and
written in Java. A programmed component is generally intended to be run on
component middleware such J2EE or .NET, and its creation requires IT technical
and management skills.
2. A declarative realization that is, the internals take the form of a declarative
script, such as a BPM process denition (usually dened using a GUI-oriented
tool, with the script itself being stored by the tool as an XML document). The
code that executes the script is an interpreter provided by middleware (such as
BPM middleware). Examples include workow and B2B denitions. Production
of a declarative component does not always require IT technical and management
skills.
It is important to understand that an Enterprise Component is primarily a design
and application code construct, and is mapped to underlying middleware technology
as far towards the end of the development lifecycle as possible. In addition, it assumes
a reasonably high level of virtual platform. Thus it is ideal as the design vehicle for
systems built according to the emerging concept of model-driven development such
as OMGs MDA.
62
requires middleware that provides optimization of the invocation. There are two
important initial constraints on an interface that makes it a network-style interface:
References passed as operation parameters must be references to other
components.12
Instances of classes are always passed by value, never by reference. That is, a
reference to something that is not a component, but which must be passed as a
parameter (for example, an Order Header class), is always passed by value.
These two constraints make it much easier to avoid the object spaghetti that resulted
in some early distributed object implementations where designers assumed that all
objects could be distributed, and ended up with dense webs of dependencies in the
form of object invocations that owed across networks. Systems built this way were
quickly found to be unworkable due to seriously appalling performance: iterating
an OOPL collection instance across a network is not a good idea! And, of course,
maintenance of such systems, with multiple cross-network low-level dependencies
was in many situations quite impossible. The lesson is that some important techniques
in classical object-oriented design and implementation, although good for code that
runs entirely in a single address space, do not scale.
A network-style interface is also loosely-coupled in the following ways:
Data carried on a request to an enterprise component should carry associated
metadata (data labels or tags). Experience over the past twenty years or so
has shown that use of metadata in messages can be exploited in some very
valuable and innovative ways. These include better management of interface
creep, and a number of ways of providing generic code that dynamically adjusts
its behavior based on the metadata provided to it. Prior to XML, this was
done using proprietary mechanisms. Today, service orientation assumes that the
messaging mechanism will be web services using XML as the data format. This
means that advantageous exploitation already identied, but not widely-known
because of the lack of standardization of the data formats, now becomes available
to service-oriented architectures (although they do not seem to have yet been
picked up by the Web Services community).
Note that this is a design not an implementation statement. Loose coupling
can be implemented using web services, and for example J2EE component
12 Strictly speaking, this statement implies that there is a concept of reference scope, where any
given kind of reference has a specic scope. For example, a URL (for a web service for example) can
have worldwide scope; a CORBA IOR has scope within a given network of interconnected CORBA
systems (which may be extended by, for example, the COM-CORBA inter-working standard); a C++
object reference has validity at most within a given address space in a single computer.
63
container providers are beginning to provide for this. However, there will be
times when tighter coupling is needed. In this case, a network-style interface
can be implemented using a more tightly-coupled interface technology. The
opposite is generally not true.
Middleware implementations of network-style interfaces will normally provide
some means of optimizing invocations if the target component is co-located
that is, in the same address space as the invoking code. If this is not available,
then either appropriate glue code must be provided (quite a tricky task), or
compromises must be made.
One such compromise is to assume the existence of network-style interfaces until
build time, when tightly-coupled interfaces are substituted. With MDA, such a
decision could be parameter-driven, with the necessary code being generated.
Can be invoked regardless of the underlying communications infrastructure.
That is, the component designer/programmer does not need to know over what
communications channel the component will be invoked. Thus a component is
insensitive as to whether an invocation is carried by a language call from within
the same address space, by RMI, JMS, CORBA, HTTP/SOAP, etc.
Can be invoked across asynchronous or synchronous communications stacks.
Is insensitive as to whether an incoming message was originally sent synchronously or asynchronously with respect to the invoking code. Providing this level
of transparency with current COTS middleware will require additional glue
code, but the advantages in simplicity for the application developer are great.
Some of the glue code may well be resident in the component, but such code
can be generated.
Can operate as a port. That is, can accept data without there being an operation
name. This provides for Enterprise Components that model business processes
to be implemented as BPM specications.
It may seem that these kinds of capabilities will result in an unwelcome overhead
for a component. However, aside from optimizations and function provided in
middleware, an enterprise component is large enough in terms of number of classes in
its implementation to be able to handle some overhead. Remember that a component
(specically a programmed component) is a kind of small program. Indeed, when
compared with a class, an enterprise component is best thought of as an adult in the
software world responsible for its own fate (thus, for example, when deactivated by
middleware for garbage collection reasons as opposed to shutdown an enterprise
64
3. Component Granularity
This section discusses the often thorny issue of component granularity. There are a
number of approaches to handling component granularity, and we choose to describe
the approach taken by Herzum and Sims (2000). The advantages of this scheme are:
Denes three clearly different kinds of enterprise component that range from a
component consisting of a small number of classes up to an entire application;
Provides for a component design scheme that is platform independent, and that
can be mapped to a number of different platforms;
Integrates scalability and dependency management aspects;
Extends across the distributed system from GUI to database;
Addresses re-use directly, and clearly denes what is intended to be potentially
re-usable and what is not;
65
Provides for a direct linkage from a requirements model (see Section 4 of this
chapter);
Denes a granularity level that is of immediate assistance as a viable unit of
project management;
Can be applied partly or wholly depending on circumstances.
The granularity scheme presented here assumes the presence of a virtual platform as
described in the previous chapter. This means that components will largely implement
only business-related concerns, and for present purposes we assume that this is wholly
the case. In reality there will be some non-business software technology that must
exist within components and that will be visible to application developers; however,
such technology as there is does not invalidate the assumption.
Since one of the levels of granularity includes distribution, we begin by describing a
distribution architecture that provides four logical distribution tiers, and that can map
to a number of physical tiers. Section 3.2 then presents the four different granularities,
and nally Section 3.3 discusses the main aspects of dependency management.
66
67
specic responsibility within the system, and that is the focus of interest across many
viewpoints. It is also a technical management domain; it is an area of the enterprise
IT system that is technically managed as a unit. Examples are the business-related
application software artifacts on a users workstation, and the set of address spaces
and systems within which an ACID13 transaction is supported. Chapter 7 discusses
transactions in some depth.
Figure 4 shows the relationships between tier and domain concepts. The term
invokes in the gure means some form of programmatic invocation, such as a Web
Service invocation, a CORBA or RMI call, a message sent via a message queuing
middleware, or sometimes an intra-process transfer of control. A Domain consists of
one Core Tier and usually one or more Outer Tiers, although sometimes a Domain
has no Outside Tiers.
It can be shown that the three-tier model is in fact a core and two outer tiers, all
within a single domain. But the essence of enterprise distributed systems is that there
are two kinds of domain in the end-to-end distribution area, and a third domain that
addresses BPM. Let us rst look at the two end-to-end domains, and the tiers within
each.
68
then responsibility for coordinating transactions lies outside the Enterprise Resource
Domains.
The nature of requests for services made to an ERD from another Domain can be an
important scalability factor in distributed systems. Where a single service request is
handled within a single ACID transaction, scalability is signicantly enhanced. If a
transaction is held open over several requests, then the system scalability reduces. The
architecture should enforce this single shot ERD access pattern. The ERD provides
one or more services. When one is requested, it runs in a single transaction.15
This rule maps well to a common business rule. That is, the business requires some
change of state to be either completed or not done at all, and is not interested in any
intermediate state, and wants the change to be made as fast as practicable.
systems, this will incur an unacceptable overhead. In this case, the architecture should be changed to
show read-only requests running non-transactionally.
69
their voice equivalent). It depends on the Workspace Tier for its source and sink
of data, and for its management in terms of user sessions.
2. The Workspace Tier is a core tier that provides a users model, and contains
user session logic and user-side representations of processes and information.
This tier consists of a set of components that communicate with components in
the enterprise tier.
It is possible that non-re-usable components are in this tier too, components that are
really to specic to one application can be potentially re-used elsewhere.
3. The Enterprise Tier is a core tier that provides enterprise-level business function
services, and is also responsible for protecting the integrity of enterprise resources
at the business logic level. Services can be either process-oriented (which typically
provide the service interface required by, for example, web services), or entityoriented (which typically provide entity services for the process services and
are typically not exposed outside this tier). The Enterprise Tier depends on
the Resource Tier for access to data and other resources (such as high-volume
printing).
4. The Resource Tier is an outer tier that provides components for access and/or
updating data and other resources. The Resource Tier provides persistent storage
services to the Enterprise Tier, and accesses mechanisms for storing data in some
manner, such as a standard relational DBMS, or an object-oriented database. It
may also provide access mechanisms to legacy system data.
Finally, the User Workspace Domain sometimes has its own persistence tier (not
shown in Figure 5). This can occur when it is important to persist the state of a
user session when the user logs off (for example, to go home at the end of a day
when a unit of work is only partly complete). Thus the User Workspace Domain can
sometimes have three tiers user, workspace, and user-resource; or, in other words,
presentation, application, and data.
70
systems or to COTS application packages) are needed. However, we assume that such
adapters are effectively part of the infrastructure, and that application developers need
not be concerned with them. This is not always the case; business-oriented developers
may need to dene data transformations to do with integrating data from different
adapters. In that case, an outer tier which might be called the data transformation
specication tier, can be dened. Again, workow requires some form of work list
visible on a users screen. However, these are typically provided by the workow
product, and as such are not the concern of the application developer. The BPM
domain is discussed in detail in Chapter 5.
Having discussed distribution aspects, we now move on to consider a useful scheme
of component granularity, one level of which will use distribution concepts.
16 This level of granularity is called a System-Level Component in Herzum and Sims (2000). Here
71
17 When rst mooted as a concept at a higher level of abstraction than code, the DC was named
distributable component, reecting its network-style interfaces, together with the idea that it could
be moved to a different machine and (pace performance) would still work correctly. However, it turned
out that distributable component was much more difcult to use in conversation than distributed
component, which in turn is usually shortened to DC.
18 CORBA Component middleware is now becoming available; for example, see
http://openccm.objectweb.org/.
19 It was the intention when EDOC was being dened to include a full specication of a distributed
component. However, for various non-technical reasons, the specication was not completed at the
time EDOC was standardized.
72
73
Distribution Aspect
A BC consists of at least one DC, and it must have at least one workspace tier or one
enterprise tier DC. Of course, it may have both, and it sometimes has more than one
DC in a given tier. Each DC fullls the responsibilities of its tier within the BC.
An example of a BC consisting of only an enterprise tier DC is a calculation engine
that it implemented as a DC. For example, in ERP systems, a price calculator, often
very complex, may be produced as a BC whose realization is a single enterprise-tier
DC.
20 For further information, see Sims (2002).
74
A BC is not required to have to have all four tiers. However, its tiers are always
adjacent tiers in the four-tier model. That is, while one BC may have all four tiers
(user, workspace, enterprise, resource), or perhaps only two for example, enterprise
and resource only, it will never consist of tiers that are not adjacent. For example, a
BC consisting of only user and resource tiers would be invalid.
The interfaces of a BC are provided by (delegated to) one of the DCs in the enterprise
tier, and optionally one of the DCs in the workspace tier.
Service Orientation
A BC provides business-related services through its interfaces not only at the required
server (enterprise tier) level, but also, where advanced user interaction designs are
being applied, at the workspace tier level as well. Enterprise services are provided by
process BCs to BPM components and also to external requestors. Entity services are
provided to process BCs and also to BPM components.
BC Benets
The BC concept does a number of important things, and in particular provides ve
valuable benets:
1. Link with Requirements: It provides a direct link with the business requirements
model which knows nothing about distribution tiers (see Section 4 of this
chapter).
2. Project Management Unit: As a cohesive collection of DCs, the BC is an ideal
unit of project management, and valuable and meaningful metrics can be easily
derived. This makes for much more accurate prediction than is often the case.
75
76
that are used as parameters in operation signatures) that are dened for the provided
interfaces. For further detail, see Sims (2001).
The value of the BC as a unit of asset ownership is enhanced by the development
lifecycle aspect, where a BCs lifecycle must also be managed, from the start of
its development, then into operational use, through subsequent evolution, to its
retirement perhaps many years later.
A full treatment of the richness of the business component concept is beyond the
scope of this chapter, but is presented well in Herzum and Sims (2000). Other authors
also suggest a similar concept. Richard Hubert, for example, talks of a component
having both client and server personalities, and says, These personalities exist to
cleanly encapsulate and denote the two design partitions inevitably required of any
component if it to be distributed. (Hubert 2002, p. 87)
77
Manager in the example); that is, a union of the Invoice Managers workspace tier
and enterprise tier interfaces. The enterprise service interface that is, the interface
that would be published in a UDDI repository is almost always the enterprise tier
interface only. (See Chapter 6 for a more detailed discussion of UDDI.)
In order to show how the tiers within each business component interact, we can
atten the gure out, the result being shown in Figure 9. Each BC is shown as
a gray (blue in e-book version) rectangle. Within each BC are DCs implementing
its various tiers. The DCs are named by their tier, so that, for example, the DC
implementing the enterprise tier of the Customer BC is known as the Customer
Enterprise-Tier Distributed Component or just Customer EDC for short. Other
naming conventions are possible, of course, but this one, although a little acronymheavy at rst glance, has proven simple for developers to use once the concepts have
been introduced.
Black solid arrows show intra- and inter-BC invocations. The assumed component
architecture allows intra-BC invocations between workspace and enterprise tiers;
some architectures disallow this, routing all invocations through the top-level process
BC.
the Customer business component can manage itself. Actually, this is unlikely for customer in most
businesses, since normally at least a credit check is required as part of the add new customer business
process. See Herzum and Sims (2000) for a discussion of naming conventions, and also for a discussion
of styles of entity components.
78
Figure 9 does not repeat the process/entity/utility layering, although it is more or less
implicit in the positions of the BC.
Finally, with regard to Figure 9, it is worth saying something about the DCs in the
user tier. In the gure, they each appear to presents a different panel to the user. This
is certainly not the intent. The various panels are normally presented as panes and/or
pop-up windows within a window that presents a tool appearance.
Several views of the essential component model are needed. The diagrams above
show component-centric views. A common additional view is that of the data base
schemas. Another is the set of user workspace domain components, and yet another
is a view of the set of enterprise resource domain elements. Such views are normally
provided through development tools.
Finally, note that the user and workspace tiers in an AC constitute its user-workspace
domain. It is not unusual for an AC to provide for a number of different user
experiences such as browser, PC, PDA, and phone. In this case there will be a separate
user-workspace domain for each experience, although it is quite possible that many
of the same workspace tier DCs will be used in each domain.
79
of this tool provides not only normal UML modeling, but also a prole building tool.
80
correctness of the model as far as proper use of the proled concepts is concerned.
This is an excellent way of delivering architecture to the application developer. When
a prole denes scalability patterns and constraints, then the result is that run-time
implementations whose structure is generated from the design models are likely to be
inherently scalable, and also conform in all respects to the modularization and re-use
standards dened by the prole. This approach is an important aspect of the OMGs
MDA (Model-Driven Architecture) strategy (OMG1 2003).
81
Figure 8 illustrates this pattern, with the process BC at the top invoking entity
components in lower layers. A formal model of the constraints inherent in
this approach would show a directed acyclic graph of invocation dependencies.
Essentially this says that Process Components use Entity Components and/or Utility
Components. Entity Components can use Utility Components, and nally Process
Components can invoke other Process Components when the process layer is further
sub-divided. BPM components operate at a higher layer than the process BC, which
is how application components are federated.
An Entity component is responsible for managing a specic set of data, and can
be thought of as owning that data. It provides entity services to other (typically
process) components, and protects the integrity of the data as far as enforcement of
business rules directly to do with that data is concerned (for example, validation).
A signicant advantage of entities owning their data is the reduction of dependencies
between data access mechanisms and schema on one hand, and business logic
on the other. Often a traditional application that needs to access, say, customer
data, will do so directly using SQL. This creates a web of dependencies between
the database and multiple applications. The entity component approach helps to
address DB schema dependency management. In the enterprise tier, entity DCs
effectively provide a service-oriented component structure to otherwise monolithic
process-oriented services.
A utility BC is a kind of entity that is of widespread use across many business
functions. An example could be an address list containing addresses for customers,
suppliers, business partners, and employees. Another example might be a currency
book that handles currency conversions, currency arithmetic, and provides exchange
rate information.23
document formal/00-06-29).
82
go part-way towards it), nor do they help with structuring already-dened services.
The resulting impedance mismatch can cause loss of information and traceability.
Without a solution to this problem, it is hard to see how any software initiative,
by itself, can hope to make business more agile, responsive, or IT become more
productive so that it can meet time-to-market, exibility, and service-orientation
goals. Failure in this area means that much of what IT delivers is likely either to not
do what the business needs IT to do, or to result in service silos. Either way, the
result is loss of agility.
So we need to be able to specify business needs with minimal information loss
while crossing the bridge between business rules and structures to IT algorithms
and modules. Many current requirements analysis methods provide mapping of the
business rules to IT algorithms. However, those IT algorithms usually end up buried
in code modules that bear little resemblance to business structures. Real and effective
traceability becomes very difcult; the bridge weakens, sometimes to the point of
collapse. But such traceability is particularly important for ESOA, where proper
identication of the components that provide the services is the key to agile IT.
The approach described in this section, called the Business Element Approach,24
provides for changes to business processes or rules being quickly and unambiguously
be traced to one or more specic components. In addition, new business structures
and algorithms are analyzed such that the structures dened in the requirements
activity become the start of the IT design model.
We start by suggesting a particular approach to requirements. Then we show how
the resulting business-oriented model can be directly implemented by the kinds of
software component discussed previously.
4.1. Requirements
The objective of the requirements activity25 is to dene precisely what services the
planned system should provide, how they are carried out, and what business features
it should exhibit. The requirements activity ends when all relevant business questions
have been answered. Therefore, it is not some high-level scoping activity (although
24 This term is due to Taylor (1995), and his approach is further described in Hubert (2002).
Extension of this work was done within the COMBINE project (Combine 2003), and also after that
project completed.
25 We use the generic term requirements as the name of the activity that denes precisely what the
business wants and needs of IT. This activity goes by many names in the industry, including business
modeling, requirements, requirements analysis, scoping and denition, etc.
83
that is part of it); rather it is a signicant part of the system development effort, and
goes into substantial business detail. However, it does not include IT system design.
The main elements of the process are as follows:
Dene scope, vision, and goals;
Dene the business requirements in terms of business processes and resources
used or created by those processes (resources are sometimes known as business
objects, or entities);
Dene the business elements that the IT system will implement; and
Dene user interaction requirements.
It should not be assumed that this list implies a sequence. More importantly, following
description of business elements should certainly not be interpreted as implying a
waterfall-style process. Such is certainly not the case.
84
Business processes, each of which has one or more steps, and where each step
is, where appropriate, further rened as a process in its own right. A process
provides a service (possibly an internal service), and the steps dene how the
service is provided. A bottom-level process is often a set of steps that constitute
what might be called a procedure or algorithm.27
Resources28 used by or produced by steps, and which provide limited-scope
services to processes.
Processes may be captured in text within use case models, or more formally by
UML classes or action states. We can identify a number of different kinds of process,
differentiated by business-related factors. Of relevance here is an immediate process.
An immediate process is one that is required to complete as soon as possible, and
whose intermediate states are of no concern to the business in that they are not
required to be remembered after the process has completed. An immediate process
is performed autonomously, with no intervention from a human. It typically denes
a service that would be provided by the core enterprise system (see Section 1 of the
previous chapter). Other kinds of processes would map to BPM specications.
Resources are captured in a business object model or an entity model. Examples
are Customer, Balance, Address, and Order Line. Given models of immediate
processes, and resources, we can dene the set of business elements that are within
the scope of a given project.
85
p. 463).
86
Example
The RBE example starts from a business resource model (or business object model).
Figure 11 shows a highly simplied sample resource (or business) model. Let us
assume that Employee, Customer, and Order are identied as the focus resources.
Following the identication heuristic to group auxiliary resources results in the three
focus groups illustrated in Figure 12.
30 The terms focus and auxiliary are UML stereotypes, and have the same semantics here.
87
When these are disentangled, three distinct resource business elements emerge, as
shown in Figure 13. The result is a signicant simplication of the original resource
model, and no information is lost. Indeed, some has been gained, since the resource
model can now be shown in its RBE view, which presents only the important
resources. One of the interesting simplications is that the various relationships have
also been grouped, leaving only one inter-RBE relationship. Finally, note that some
88
auxiliary resources appear in more than one RBE. This is not surprising. However, a
given focus resource appears in only one RBE.
Before leaving subject of RBEs, it can be seen that each RBE is represented in Figure 13
as a UML2 component. This illustrates well one of the intents of UML2 components
that they should apply throughout the development lifecycle including the
business model, or Computation-Independent Model (CIM) in the OMGs MDA
parlance. In this case, we can use the components concept of type and also it is
concept of realization. Some business modelers may think this use of the UML2
component concept is wrong that a business model should not show the least
indication of something that may be misinterpreted as eventual implementation. In
that case, a suitable model element for an RBE could be a UML package.
Identication Heuristic
To identify Service Business Elements (SBEs):
1. Identify the highest-level immediate steps in the business process model. These
are services provided by the core business systems. The name of each step is
probably of the form verb-noun. Many of the nouns will probably be the
names of RBEs, for example Supplier, Shipment, Contract, Schedule, Invoice,
or Product.
2. Group the steps by RBE. It is likely that each group will include the CRUD31
lifecycle of the RBE.
Many groups will involve more than one resource BE. For example, a Sales Order
group could include steps that not only direct the lifecycle of a Sales Order in
some way, but also update Inventory and Customer Balance. However, the focus
of the group is often a specic resource (such as Sales Order).
Some groups may involve only one RBE. In this case, it is possible that the step
forms part of the responsibilities of the RBE rather than the SBE.
31 CRUD: Create, Read, Update, Delete.
89
3. Iterate on the next level of immediate steps in the business process model. If no
further SBEs are found, then the immediate steps at this level of iteration are
candidates for the business logic within the SBE, or possibly even within an RBE
(such as validate data provided). If there are no lower-level immediate steps
found, then stop.
Each SBE will normally map to an organizational unit, and is a candidate for
implementation as a process component. The various verbs in the names of the
immediate steps are candidate operations in the interfaces of that component.
Subsidiary immediate steps associated with each higher-level immediate step typically
constitute the process that provides the service indicated by the higher-level immediate
step.
This identication heuristic groups immediate steps such that the groups service
business elements make sense in business terms, and not only provide the basis
for a service-oriented enterprise system, but also exhibit best practice modularization
along high cohesion and low coupling principles.
90
Handle Order
Based on the example above of seven services (top-level immediate steps), the
identication and grouping heuristic could produce the following (incomplete)
SBEs:
SBE
Service
Customer Service
Validate customer
details provided
Review credit limit
Record Customer details
Check for relationships
Send the standard letter
Order Service
Employee Service
91
As can be seen, each top-level immediate step provides a service (e.g. Amend
Customer record). Each service in turn will usually consist of a set of subsidiary
immediate steps.
Identication
Delivery Business Elements can be identied by nding the top-level SBEs. A toplevel SBE is one that is not a dependant of any other SBE. For each top-level SBE,
identify the set of BEs that this SBE needs to function correctly. That is, identify
the dependent BEs of the top-level SBE. The resulting set, plus the top-level SBE,
comprises the Delivery Business Element.
Hint: In small-to-medium projects, there may only be top level SBEs. In very small
projects, there may indeed be only one, and hence the DBE will correspond to an
application.
92
A BE diagram can be constructed as BEs are identied. Applying the mediator pattern
for usages by one BE of other BEs typically results in a directed acyclic graph (as
illustrated in Figure 14). The DBE will normally be a subset of this diagram.
Example
Figure 14 illustrates the dependencies between two SBEs (Order Service and Pricing)
and three Resource Business Elements. This set of business elements together
comprises the Order Management delivery business element. Note that the UML2
component is used in the diagram to represent business elements. Only the type
part of the component is used interfaces and implementation detail are normally
added later during the IT design phase. This illustrates well a realization of the
UML2 objectives for the component concept that it should apply throughout the
development lifecycle including the requirements phase.
93
94
5. Summary
In summary, process business elements can be said to be the modules of the business.
Mature CBSE gives us a technology whereby business elements can be captured on
a one-to-one basis. This means that the IT system that supports the business is
structured along the same lines as the business.
Now suppose we provide systemic event management in the IT system, so that each
component can publish business events as they happen. It then becomes possible to
think of installing probes into the message stream which can not only measure the
ow rate between given components, but also can interrogate the message content
itself (remember that the message context is XML).
Ability to probe messages for their semantic content? This starts to sound like a kind
of business nervous system! And indeed, some enterprises today are beginning to
think along these terms. Why? Because the concept of a business control room for
real-time management of organizational units is one that has been around since the
1970s (e.g., Beer 1979). Then, it was not only the technology that was lacking, it
was also the set of software structuring concepts. Today, enterprise service-oriented
architecture can provide both the technology and the software structuring concepts.
Hence ESOA may well provide the basis for a situation where the business models,
or CIMs in MDA-speak, may be become a live model of the business, in the same
way that a railroad control center provides a live model of a railway system. And
the design models or MDA PIMs (platform-independent models) could become
the main focus and tool for synchronized business and IT agility and evolution.
The naked objects initiative (Pawson and Matthews 2002) provides the basis for
technology whereby even partly-built components can be automatically visualized on
a GUI. But here we stop: further extrapolation and exploration is beyond the scope
of this chapter.
3
ORCHESTRATION
Even before the advent of Web services, an increasingly large number of distributed
applications were constructed by composing them out of existing applications.
Enterprise Application Integration (EAI) techniques grew up from the realization
that no one infrastructural technology (e.g., CORBA or DCOM) will ever be
adopted by all of the software industry. Furthermore, although sourcing a solution to
a problem (large or small) from a single vendor is possible in the short term, in the
long term it is often the case that a corporate intranet will be running systems from a
variety of vendors, not all of which will be able to interoperate. Large multi-national
corporations often evolve through acquisitions of smaller companies who may have
different infrastructural investments. We have often heard the statement that Its
easier to interoperate with a different company than to talk to different divisions
within the same company. Therefore it should come as no surprise to learn that
large-scale applications are rarely built from scratch; rather they are constructed by
composing them out of existing applications.
Providing solutions that enable disparate (heterogeneous) technologies and applications to communicate is extremely important. Without them, a companys
infrastructure would either not be able to grow (leading to islands of isolation) or
would be at the mercy of a single vendor. For several years EAI solutions have made
it possible to compose an application out of component applications in a uniform
manner, irrespective of the languages in which the component applications have been
written and the operating systems of the host platforms. Unfortunately, most EAI
95
96
platforms offer solutions that are not interoperable with one another. Web services
offer a potential solution to this important drawback.
The resulting applications can be very complex in structure, containing many
temporal and dataow dependencies between their constituent applications. An
additional complication is that the execution of such an application may take a long
time to complete and may contain long periods of inactivity (minutes, hours, days,
weeks, etc.), often due to the constituent applications requiring user interactions.
In a distributed environment, it is inevitable that long running applications will
require support for fault-tolerance and dynamic reconguration: machines may fail,
services may be moved or withdrawn and application requirements may change.
In such an environment it is essential that the structure of applications can be
modied to reect these changes. In general, composite applications are increasing in
importance as companies combine off-the-shelf and homegrown Web services into
new applications. Various mechanisms are being proposed and delivered to market
daily to help improve this process. New fourth generation language development
tools are emerging that are specically designed to stitch together Web services from
any source, regardless of the underlying implementation.
A large number of vendors are starting to sell business process management, workow
and orchestration tools for use in combining Web services into automatic business
process execution ows. In addition, a growing number of businesses nd themselves
creating new applications by combining their own Web services with Web services
available from the Internet supplied by the likes of Amazon.com and Google.com.
These types of composite applications represent a variety of requirements, from
needing a simple way to share persistent data to the ability to manage recovery
scenarios that include various types of transactional software. Composite applications
therefore represent a signicant challenge for Web services standards since they are
intended to handle complex, potentially long-running interactions among multiple
Web services as well as simple and short-lived interactions.
Workow systems have been around for many years, pre-dating Web Services
and SOA. The core concepts behind the notion of workow are not tied to any
specic implementation environment. Therefore, in the following sections we will
examine workows from an architectural perspective before describing the Web
Services Business Execution Language (WS-BPEL) (WSBPEL), which is the current
contender for the title of workow standard for SOA.
Chapter 3: Orchestration
97
98
Chapter 3: Orchestration
99
100
is not necessary to understand how the checkStock or dispatch tasks are actually
implemented: as a user of their services all that is required is that they conform to
some pre-agreed contract.
This is an important point and one which is exemplied by the overall Web services
model. Web services are specically about fostering systems interoperability. What
makes Web services so interesting is the fact that the architecture is deliberately
not prescriptive about what happens behind service endpoints Web services are
ultimately only concerned with the transfer of structured data between parties, plus
any meta-level information to safeguard such transfers (e.g., by encrypting or digitally
signing messages). As we have already seen, this gives exibility of implementation,
allowing systems to adapt to changes in requirements, technology etc. without directly
affecting users. Furthermore, most businesses will not want to expose their back-end
implementation decisions and strategies to users for a variety of reasons.
Some workow implementations allow the internal structure of a compound task
to be modied (sometimes dynamically, as the workow executes) without affecting
the tasks which supply it with inputs or use it for inputs. In this case it would be
possible to change the payment and stock management policies, for example, causing
payment capture even if the item is not presently in stock, or the addition of a task
which could check the stock levels of the suppliers of the company and arrange direct
dispatch from them.
Chapter 3: Orchestration
101
of the application programmer, especially when issues such as reliability, fault tolerance
and adaptability are concerned. For example, at some point during its execution a
long running application is likely to encounter changes to the environment within
which it is executing. These environmental changes could include machine failures,
services being moved or withdrawn, or even the applications functional requirements
being changed. Trying to implement this for a bespoke application is hard enough
without sacricing exibility. Luckily, some of the more advanced workow systems
provide mechanisms that will allow workow applications to change their internal
structures to ensure forward progress can be made.
102
Chapter 3: Orchestration
103
2.2. Variables
During the course of a business process it is likely that application data will have to
be updated or inspected. BPEL provides the variable construct for this purpose.
A BPEL variable is a typed data structure which stores messages associated with a
workow instance. As with any workow, the state of the application is a function of
the messages that have been exchanged and variables are used to maintain this state.
Variables provide the means for holding messages that state of the business process.
The messages held may be those that have been received from partners or are to be
sent to partners. In addition, they can also hold data that are needed for holding
state related to the process but are not exchanged with partners. Variables begin in
an un-initialized state and are populated over time by the arrival of messages, or
computations being executed which populate them.
104
For example, let us assume that the checkStock process returns a message containing
the number of the required items still in the warehouse. Code 1 shows how a BPEL
variable may be created based on this message type.
<wsdl:types>
<xsd:schema>
<xsd:simpleType name="stockCountType">
<xsd:restriction base="xsd:int"/>
</xsd:simpleType>
</xsd:schema>
</wsdl:types>
<variables>
<variable name="itemsAvailable"
type="props:stockCountType"/>
</variables>
Code 1. An example of a BPEL variable
As we mentioned earlier, BPEL denes some XPath extension functions. One of those
functions is shown in Code 2 and is used to get a variables value:
bpws:getVariableProperty(variableName, propertyName)
Code 2. The XPath function to return a property value from a message
The rst parameter is the name of a source variable (message type) and the second
is a qualied name (QName) of a property to select from within that variable. If the
property does not appear in the message, then it is implementation dependant as to
what is returned. Otherwise, a node set containing the single node representing the
property is returned.
For example, let us return to the checkStock process that returns a message indicating
the amount of stock left. Our workow process may prioritize clients and only fulll
a purchase request for a specic low-priority client if it does not drop the stock below
a specic level, in case a high-priority client request comes in before the stock can
be replenished. Code 3 illustrates how this could be modeled: the source variable
stockResult is the message returned by executing the checkStock process and part
of this message has an element level that contains the current amount of the request
items remaining in stock.
Chapter 3: Orchestration
105
<case condition="bpws:getVariableProperty(stockResult,level)
> 100">
<flow>
<!-- there is enough stock to allow a low-priority
order -->
</flow>
</case>
Code 3. An example of using getVariableProperty
We have looked at some of the basics of BPEL, such as variables and the ability to
dene expressions. In the next section we will build on these to show how relationships
between business processes can be dened and interactions between those processes
controlled.
106
a priori (a general logging service may fall into this category if it is implemented to
take log information from any service in a corporate network).
The partner links are used to model the actual service with which a business
process interacts. It is important to understand the distinction between partner
links and partner link types: more than one partner link can be characterized by
the same partnerLinkType. If we go back to the process order application, it is
possible that the checkStock task may use more than one supplier, but the same
partnerLinkType. The syntax for a partnerLink is shown in Code 5:
<partnerLinks>
<partnerLink name="ncname" partnerLinkType="qname"
myRole="ncname"? partnerRole="ncname"?>+
</partnerLink>
</partnerLinks>
Code 5. The partnerLink syntax
As can be seen, each partnerLink must be named and this name is used for all
interactions via that link. myRole is used to indicate the role of the business process,
whereas partnerRole shows the role of the partner.
The business partner role is used to represent relationships with a specic partner.
Such business partnerships often require more than one conversational relationship.
For example, as shown in Code 6, the AuthorizationCapture partner is required
to provide the roles of both payment authorization and payment capture. The
denition of these capabilities appears in the partner element:
<partner name="AuthorizationCapture"
xmlns="http://schemas.xmlsoap.org/ws/2003/05/partner-link/">
<partnerLink name="PaymentAuthorization"/>
<partnerLink name="PaymentCapture"/>
</partner>
Code 6. An example of a business partner role
Partner denitions are optional and need not cover the entire partner links dened in
the process. From the process perspective a partner denition introduces a constraint
on the functionality that a business partner is required to provide. It is important that
partner denitions do not overlap, i.e., a partner link cannot appear in more than
one partner denition.
Chapter 3: Orchestration
107
108
Chapter 3: Orchestration
109
<definitions name="properties"
targetNamespace="http://example.com/orderProcessCorrelation.wsdl"
xmlns:poc="http://example.com/processOrderCorrelation.wsdl"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/businessprocess/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<!-- define correlation properties -->
<bpws:property name="customerID" type="xsd:string"/>
<bpws:property name="orderNumber" type="xsd:int"/>
<bpws:property name="dispatchNumber" type="xsd:id"/>
</definitions>
110
<message name="POMessage">
<part name="PO" type="pom:ProcessOrder"/>
</message>
<message name="POResponse">
<part name="PO" type="pom:ProcessOrder"/>
</message>
<message name="DispatchMessage">
<part name="IVC" type="pom:Dispatch"/>
</message>
<bpws:propertyAlias propertyName="poc:customerID"
messageType="pom:POMessage" part="PO"
query="/PO/CID"/>
<bpws:propertyAlias propertyName="poc:orderNumber"
messageType="pom:POMessage" part="PO"
query="/PO/Order"/>
<bpws:propertyAlias propertyName="poc:dispatchNumber"
messageType="pom:DispMessage" part="IVC"
query="/IVC/InvNum"/>
...
</definitions>
Code 8. The process order messages
Finally, the portType used is dened, in a separate WSDL document, as shown
in Code 9. This example shows both the synchronous (request-response) and
asynchronous (one-way) operations.
<definitions name="orderingPortType"
targetNamespace="http://example.com/ordering.wsdl"
xmlns:pom="http://example.com/processOrderMessages.wsdl"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<portType name="OrderingPortType">
<operation name="SynchronousOrder">
<input message="pom:POMessage"/>
<output message="pom:POResponse"/>
</operation>
<operation name="AsynchronousOrder">
<input message="pom:POMessage"/>
</operation>
</portType>
<portType name="OrderSubmitterPT">
<operation name="AsynchronousOrderResponse">
<input message="pom:POResponse"/>
Chapter 3: Orchestration
111
</operation>
</portType>
</definitions>
Code 9. Process order portType
Both the properties and their mapping to purchase order and invoice messages will
be used in the correlation set examples shown in Code 10:
<correlationSets
xmlns:poc="http://example.com/processOrderCorrelation.wsdl">
<!-- Order numbers are particular to a customer, this set is
carried in application data -->
<correlationSet name="ProcessOrder"
properties="poc:customerID poc:orderNumber"/>
<!-- Dispatch numbers are particular to a completed order, this
set is carried in application data -->
<correlationSet name="Dispatch"
properties="poc:invoiceNumber"/>
</correlationSets>
Code 10. The process order correlation sets
If we take the case of the ProcessOrder operation, then we can see how it is supposed
to work. Figure 5 shows the interaction messages between the client and the process
order service in a UML interaction diagram. For simplicity we have omitted the
interactions between the Orchestrator and the internal processes we saw in Figure 4.
In this case the customerID and orderNumber will be associated with the request
message. The combination of the values of these properties must be unique in the
scope of this workow. Any response message will also have these values associated
with it such that the response can be delivered to the right process instance. As we
have already mentioned, it is up to the BPEL implementation to ensure that these
messages are correctly delivered, so all you need to do is make sure that a correlation
set is appropriately dened and related to your message invocations.
Now that we have seen how to create business relationships and manage the
interactions between them through correlation sets, we need to discuss how an actual
workow (or business process interaction ow) can be dened within BPEL. We will
do that in the next section, where we will discuss in some detail the different types of
interaction patterns that BPEL supports.
112
2.5. Activities
As we saw when rst talking about workow systems, they are typically used when
controlling the ow of an application within a corporate intranet. However, there is
nothing intrinsically restrictive about workow models that prevent them from being
used across an enterprise boundary. In fact this is precisely the area where BPEL is
aimed: describing inter-enterprise business interactions, where the individual business
processes from each enterprise are represented as Web services.
BPEL models all stages of a workow as activities. Activities are composed into scopes
to form algorithmic workows. Each scope has a primary activity that denes its
normal behavior; the primary activity can be arbitrarily complex and be composed of
many sub-activities (nested activities). In this case, the scope is shared by all nested
activities.
In order to execute a process, we must have some means of describing its behavior.
The BPEL language provides a number of fundamental activities which form the
basic building blocks of the workow and provide support to manipulate data, iterate,
Chapter 3: Orchestration
113
call external functions etc., and how to compose these primitives into meaningful
workows. The language also provides for the structuring of activities to manage
control ow dependencies in a workow. They are responsible for serializing and
parallelizing activities, choosing from alternative paths in a workow, etc.
BPEL classies these activities as either basic or structured types. Basic activities deal
with state management, communication and exception handling, while structured
activities deal with process control-ow issues. In the following sections we will
briey examine the different activity types. If you are familiar with most high-level
programming languages (e.g., C++, Java, C# etc.), then most of the principles behind
these primitives should be fairly intuitive.
2.5.1. <assign>
This construct can be used to update the values of variables with new data (e.g.,
messages). It can contain any number of elementary assignments and it is important
to understand that the type of the source from which the data comes must be the
same as the type of the destination to which it is being assigned.
A typical example of assignment is where the contents of one message are copied
into another. This is illustrated in Code 11, where the address details of a customer
placing a purchase order are copied to some dispatch data prior to shipping the order.
<assign>
<copy>
<from variable="processOrder" part="customerAddress"/>
<to variable="dispatchData" part="customerAddress"/>
</copy>
</assign>
Code 11. An assign example
The syntax for <assign> is actually quite powerful. The syntax for from is captured
in Code 12:
<from variable="ncname" part="ncname"?/>
<from partnerLink="ncname"
endpointReference="myRole|partnerRole"/>
<from variable="ncname" property="qname"/>
<from expression="general-expr"/>
<from> ... literal value ... </from>
Code 12. The assign-from syntax
114
Chapter 3: Orchestration
115
<to variable="dispatchToName"/>
</copy>
<copy>
<from variable="customerName" part="address"/>
<to variable="dispatchToAddress"/>
</copy>
</assign>
Code 15. An extended assign example
2.5.2. <receive>
Web service operations are exposed to the outside world by a receive activity. This
construct allows the business process to do a blocking wait for a matching message
to arrive. The receive activity is the workow entity which a WSDL operation
maps onto, and so it species the partner it expects to invoke the corresponding
operation, and portType and operation that it expects the partner to invoke.
Code 16 shows the <receive> activity that the purchase order system might expose
as its ProcessOrder operation. The workow uses a variable called PO to hold
incoming messages from customers. When a POMessage is received from a customer
the <receive> activity is activated and a new instance of the workow is created to
run.
<variables>
<variable name="PO" messageType="POMessage">
</variables>
<receive partnerLink="ordering" portType="purchaseOrderPortType"
operation="ProcessOrder" variable="PO">
</receive>
Code 16. A receive example
<receive> is a blocking activity, which means that any workow process that
depends upon the receipt of an appropriate message cannot execute until that event
occurs. The creation of process instances in BPEL is always implicit. Activities that
receive messages (<receive> and the <pick> activity we will see later) can be
annotated to indicate that the triggering of that activity should cause a new instance
of the business process to be created. This is done by setting the createInstance
attribute on the activity to yes. To be instantiated, each business process must
contain at least one such start (initial) activity; obviously such an activity cannot have
a preceding activity in the ow.
116
2.5.3. <invoke>
This construct allows the business process to invoke a one-way or request-response
operation on a portType offered by a partner. In order to execute a request-response
operation, two variables are required for input (request) and output (response)
messages.
<invoke partnerLink="PlacePurchaseOrder"
portType="PurchaseOrderSystemPortType"
operation="ProcessOrder"
inputVariable="CustomerDetails"
outputVariable="InvoiceDetails"/>
Code 17. An invoke example
In Code 17, the invoke activity calls the ProcessOrder operation (from the
PurchaseOrderSystemPortType which is exposed by the PlacePurchaseOrder
partner) when a message from the CustomerDetails variable is received. The result
of executing the operation is the placement of a message in the InvoiceDetails
variable. Obviously sending a message may result in an error (the recipient has
crashed, for example), so a request-response operation may also have to deal with
fault messages, but we will look at those later.
An asynchronous one-way operation is slightly simpler, since there is no
outputVariable. This would t the scenario where interactions between partners
may occur over a long period of time, for example, as illustrated in Figure 5. The
response to a given one-way operation would then be another one-way operation. If
you consider the example above, we could imagine separating the message request
for the purchase from the message response that is the invoice into two one-way
interactions.
Chapter 3: Orchestration
117
2.5.4. <reply>
This construct allows the business process to send a synchronous message in reply to a
message that was received through a <receive>. The combination of a <receive>
and a <reply> forms a request/response operation on the WSDL portType for the
process.
<reply partnerLink="purchasing" portType="purchaseOrderPortType"
operation="sendPurchaseOrder" variable="Invoice"/>
Code 18 A reply example
In Code 18 you can see the purchaseOrder systems response to the initial
purchase request. The purchasing partner is sent a message from the Invoice
variable (which contains messages with invoice details), as a result of invoking the
sendPurchaseOrder operation.
2.5.5. <throw>
This activity generates a fault from inside the business process. Every fault is required
to have a globally unique name, and the <throw> must provide the name for the
fault; it can optionally provide additional data (via variables) that may give more
information about the fault. A fault handler can then use the data to inspect and
handle the fault and perhaps use the information to populate any fault messages that
may need to be sent to other services; we will examine fault handlers in the next
section.
<throw faultName="CustomerNotSubscribed"
faultVariable="CustomerOrderFailureVariable"/>
Code 19. A throw example
For example, in Code 19, we have slightly modied the orderProcess ow that we
have seen already. In this case, only customers who have previously subscribed with
the system are allowed to place orders. Therefore, in the case where a customer who
has not subscribed attempts to place an order, the <throw> activity will populate
the CustomerOrderFailureVariable with sufcient data so that the workow
process that deals with the initial placement of orders can create an appropriate failure
message and sent it to the prospective customer.
118
2.5.6. <catch>
Handling faults is also follows a similar pattern to common programming languages
like C++, Java, and C#. A <catch> declaration is used to handle specic faults
occurring within a scope, and a catchAll declaration within the activitys scope
faultHandlers declarations will handle any faults not handled by a more specic
<catch> at the same scope.
For example, in Code 20 we have dened two specic faults that clients of
our order process system may encounter when attempting to place an order and
which we can handle explicitly: the CustomerNotSubscribed fault we mentioned
earlier and a fault that indicates that the system may be unavailable (e.g., crashed),
OrderProcessSystemNotResponding. However, other faults may arise that cannot
be handled by these two fault handlers and in which case we rely on the catchall
activity.
<bpws:faultHandlers>
<bpws:catch faultName="CustomerNotSubscribed">
<!-- Handle the fault -->
</bpws:catch>
<bpws:catch faultName="OrderProcessSystemNotResponding">
<!-- Handle the fault -->
</bpws:catch>
<bpws:catchAll>
<!-- Unexpected fault, shutdown -->
...
</bpws:catchAll>
</bpws:faultHandlers>
Code 20 An example of using the catch activity
2.5.7. <terminate>
When this activity is carried out, the process instance is immediately terminated
without the ongoing work being undone and compensated. The BPEL implementation must terminate all running activities in the process as soon as possible without
any attempt at fault handling.
If we look at Code 21, we can now use <terminate> in the catchall block to exit the
process if any unexpected error occurs. Obviously, this may not be the best course of
action for all processes, but this is just an example.
Chapter 3: Orchestration
119
<bpws:faultHandlers>
<bpws:catch faultName="CustomerNotSubscribed">
<!-- Handle the fault -->
</bpws:catch>
<bpws:catch faultName="OrderProcessSystemNotResponding">
<!-- Handle the fault -->
</bpws:catch>
<bpws:catchAll>
<!-- Unexpected fault, shutdown -->
<terminate/>
</bpws:catchAll>
</bpws:faultHandlers>
Code 21 Using terminate in the catchall handler
2.5.8. <sequence>
This construct allows you to dene a collection of activities to be performed
sequentially in lexical order (the order in which they occur in the syntax). In the
example below, the sub-activities are executed serially.
<sequence>
<invoke partnerLink="paymentAuthorization" .../>
<invoke partnerLink="dispatch" .../>
<invoke partnerLink="paymentCapture" .../>
</sequence>
Code 22 An example of the sequence activity
2.5.9. <ow>
This construct allows you to specify one or more activities to be performed concurrently. A <flow> completes when all of its constituent activities have completed.
If you look back at the process order scenario depicted in Figure 3, it is possible
to see that when an order is rst made, the Authorization stage (whether the client
can place orders) and the checking of whether the order can be fullled, occur in
parallel. How this may be accomplished in BPEL is shown in Code 23, where the
two <invoke> activities (PaymentAuthorization and CheckStock) are enabled
to start concurrently as soon as the <flow> is started. The <flow> completes when
both of the activities respond (we will assume they are invoked in a synchronous
request/response manner). The Dispatch is invoked only after the <flow> completes
(we will assume that there are no preceding errors).
120
<sequence>
<flow>
<invoke partnerLink="PaymentAuthorization" .../>
<invoke partnerLink="CheckStock" .../>
</flow>
<invoke partnerLink="Dispatch" .../>
</sequence>
Code 23 The process order example in BPEL
In the example above, the two concurrent activities have no dependencies between
them. This is not always going to be the case and synchronization dependencies will
exist between activities in a <flow>, i.e., some activities may have to be executed in
a specic order. As such, BPEL provides a link construct that can be used to express
these dependencies. A link is named and all links in a <flow> must be dened
separately. Two activities can be linked together using source and target elements.
Every link must have precisely one activity in the <flow> as its source and precisely
one <flow> activity as its target. The source may also specify a transition condition
through the transitionCondition attribute of the source element. All links that
do not have an explicit transitionCondition attribute have a default attribute
associated with them with a value of true.
BPEL provides another XPath extension to assist in using links, which is shown in
Code 24:
bpws:getLinkStatus (linkName)
Code 24 The XPath function for checking the status of a link
This function returns a Boolean value which indicates the status of the link in the parameter. The status of a link is determined by evaluating its transitionCondition
attribute. This evaluation occurs on the actual values of the variables referenced in
the expression, so if they are also modiable via a concurrent path, the result may be
non-deterministic. If the evaluated result is true then the status is positive, otherwise
it is negative.
getLinkStatus can only be used in a <join> condition. The parameter must refer
to the name of an incoming link for the activity associated with the <join>.
In the example shown in Code 25, we have taken the example of sourcing a book
from an online book shop, pricing shipping and handling and insurance costs, and
then charging the entire cost to a bank account. Locating the book, shipping and
handling and insurance costs can all occur in parallel and the example BPEL code
shows this because each service interaction is a separate <sequence> or <invoke>.
Chapter 3: Orchestration
121
However, the nal operation, debiting the bank account, cannot occur until all three
previous activities have completed. This is ensured because it is related to the other
activities through the link synchronizations dened at the top of the <flow>.
<bpws:flow>
<bpws:links>
<bpws:link name="BookCost"/>
<bpws:link name="ShippingCost"/>
<bpws:link name="InsuranceCost"/>
</bpws:links>
<bpws:flow>
<!-- Buy the book -->
<bpws:sequence>
<bpws:invoke name="OnlineBookShopInvocation"
partner="BookShop">
...
</bpws:invoke>
<bpws:receive name="BookShopResponse" ...>
<bpws:source link="BookCost" .../>
</bpws:receive>
</bpws:sequence>
<!-- Buy shipping and handling -->
<bpws:sequence>
<bpws:invoke name="ShippingInvocation"
partner="ShippingAndHandlingService">
...
</bpws:invoke>
<bpws:receive name="ShippingResponse" ...>
<bpws:source link="ShippingCost" .../>
</bpws:receive>
</bpws:sequence>
<!-- Buy insurance -->
<bpws:invoke name="InsuranceInvocation"
partner="InsuranceBroker">
<bpws:source link="InsuranceCost"/>
...
</bpws:invoke>
<!-- Online bank account -->
<bpws:invoke name="BankAccountInvocation"
partner="Bank" ...>
122
<bpws:target link="BookCost"/>
<bpws:target link="ShippingCost"/>
<bpws:target link="InsuranceCost"/>
...
</bpws:invoke>
</bpws:flow>
Code 25. An example of ow and link
2.5.10. <scope>
This construct allows you to dene a nested activity with its own associated variables,
fault handlers and compensation handler. It is a way of allowing activities to share
common error handling and compensation routines. A <scope> consists of the
primary activity that denes the behaviour of the <scope>, a set of optional fault
handlers and a single optional compensation handler. Each <scope> can be named,
which is important when you may have to refer to one <scope> from within another.
<bpws:scope>
<bpws:faultHandlers>
<bpws:catch faultName="OutOfStockFault" .../>
<bpws:catch faultName="UnknownStockFault" .../>
<bpws:catch faultName="UnauthorizedClientFault" .../>
<bpws:catchAll>
<bpws:compensate/>
</bpws:catchAll>
</bpws:faultHandlers>
<!-- place order -->
</bpws:scope>
Code 26. An example of the scope activity
Code 26 illustrates how an order may be placed against the
processOrderApplication. At the bottom of the <scope> is the normal behaviour
of the activity, i.e., the placement of an order by a client. However, the <scope>
declares a number of fault handlers with catch activities; the aim of these handlers
it to provide a means to cope with the different types of failures that may occur
during the order placement process. For example, the quantity of the item that is
required by the client may not be available in the warehouse and as such an error
message (OutOfStockFault) will be returned and caught; the process then had the
Chapter 3: Orchestration
123
opportunity to try something else, e.g., request less stock, or wait until the warehouse
has been restocked.
The catchall handler has been declared slightly differently in this example: if
we assume that the other fault handlers allow the application to continue to make
forward progress (albeit at a reduced capacity), what happens if an error occurs that
simply cannot be handled in this way or is unexpected? The answer is that in these
situations the entire <scope> may have to be compensated. In the example, the
compensate activity runs the compensationHandler for all of the inner scopes,
which will perform any work necessary to bring the application to the state it had
before the scope was executed. If nested scopes were named, it would be possible to
limit the compensation to a specic scope.
<scope>
<compensationHandler>
<invoke partnerLink="Buyer"
portType="SP:OrderPlacement"
operation="CancelOrder"
inputVariable="getResponse"
outputVariable="getConfirmation">
</invoke>
</compensationHandler>
</scope>
Code 27. A compensationHandler example
Compensation is an important requirement for long running business processes and
had existed in workow systems from the start. Automatic compensation of failures
is possible in only the simplest of situations for business transactions, which rely on
traditional ACID transaction systems to scope their work. In these cases, backward
compensation is provided for by the underlying transaction system, which does not
have (nor does it need to have) any semantic knowledge of the application or what it
is compensating. However, in the case of long running business transactions, ACID
transactions are unsuitable and automatic compensation is not possible: in order
to compensate for complex business-to-business interactions does require semantic
knowledge of the application. As such, compensation handlers have to be written by
the application programmer, since this where the semantic knowledge resides.
Where fault handlers provide alternative forward execution paths through a scope,
compensation handlers, when invoked, undo the work performed by a scope. Since
a compensationHandler for a specic scope reverses that scopes work, the handler
can potentially be as complex and intricate as the scopes normal original activity.
124
2.5.11. <wait>
This construct allows a process to unconditionally wait for a given (xed amount)
time period or until a certain time has passed. A typical use for this feature is shown
in Code 28, where the checkStock process waits for a specic time before it checks.
<bpws:while condition="true">
<!-- XML Schema string form 24 hours -->
<bpws:wait until="2004-11-12T18:00+01:00"/>
<!-- Inventory process -->
</bpws:while>
Code 28. An example of the wait activity
2.5.12. <pick>
This activity type allows you to block and wait for a suitable message to arrive or
for a timeout to expire. When one of these triggering events occurs, the associated
activity is performed. A <pick> activity declares events that it will trigger on and
corresponding activities to execute once those events occur. Events can take the form
of either the receipt of a message or a time-based event including both duration (time
relative from now) and deadline (xed future time).
It is possible for a <pick> activity to be the rst activity executed by a workow by
being the rst recipient of a message in that workow, in which case it acts like a
receive activity and is annotated with a createInstance="yes" attribute.
Irrespective of whether or not a <pick> activity is used to instantiate a workow
instance, every such activity contains at least one onMessage event. For those <pick>
activities which do not instantiate workows, the onMessage events constrain the
scope in which the activity becomes active.
An example <pick> activity is shown in Code 29, where the activity waits on a
response message from the checkStock system via its onMessage declaration. In
this example, the checkStock system should respond within 1 day and 10 hours or
an error is assumed to have occurred and a timeout is triggered through the onAlarm;
we will assume some fault handling mechanism is executed here.
Chapter 3: Orchestration
125
<bpws:pick createInstance="no">
<bpws:onMessage partner="CheckStock"
portType="CheckStockPortType"
operation="checkResponse" variable="WarehouseResponses">
<bpws:correlations>
<bpws:correlation set="BookingsCorrelationSet"/>
</bpws:correlations>
<!-- Continue with booking -->
</bpws:onMessage>
<bpws:onAlarm for="P1DT10H">
<!-- Stock warehouse did not respond! Problem! -->
</bpws:onAlarm>
</bpws:pick>
Code 29. An example of a pick activity
2.5.13. <switch>
This construct allows you to select exactly one branch of activity from a set of
possible choices. It is similar in name and design to switch statements you will
nd in popular languages such as C++ and Java. As you can see in Code 30
(which illustrates the checkStock process using the getVariableProperty XPath
extension we discussed earlier), the case activity consists of an ordered list of one
or more conditional branches (dened by case elements), followed by an optional
otherwise branch (the same as the default case branch in most programming
languages).
<bpws:switch>
<bpws:case condition="bpws:getVariableProperty(stockLevel,
level) < 10" >
<!-- place a high priority request for more stock -->
</bpws:case>
<bpws:case condition="bpws:getVariableProperty(stockLevel,
level) <= 100" >
<!-- place a low priority request for more stock -->
</bpws:case>
<bpws:otherwise>
<!-- stock level is ok -->
</bpws:otherwise>
</bpws:switch>
Code 30. An example of the switch activity
126
2.5.14. <while>
This construct allows you to indicate that an activity is to be repeated until a
certain success criteria has been met. For example, as shown in Code 31, part of the
checkStock process checks the level of stock in the warehouse and while it remains
below a threshold level it places a request for more stock and waits until the request
has been fullled.
...
<variable name="stockLevel" type="xsd:integer"/>
...
<while condition= "bpws:getVariableData(stockLevel) <= 10">
<scope>
<!-- place order for more stock -->
</scope>
</while>
Code 31. A while activity example
2.5.15. <empty>
This construct (shown in Code 32) allows for the insertion of a null-operation
instruction into a business process, which may be useful for synchronization of
concurrent activities.
<empty standard-attributes>
standard-elements
</empty>
Code 32. Syntax of the empty activity
So far we have discussed how to dene business relationships and manage their
interactions. However, we have not talked about transactions: the ability to scope
units of work such that either all of that work happens or none of it does, despite
failures of any of the processes involved in the work. As we saw earlier, when
BPEL4WS was originally released, it came with two other specications; the WSCoordination and WS-Transaction specications. Although we will talk much more
about transactions in a later chapter, it is worth discussing how they relate to BPEL
in the following section.
Chapter 3: Orchestration
127
2.6. Transactions
At this stage you may be wondering about the relationship between BPEL and Web
Services transactions. For example, in some cases it may seem appropriate to map a
<scope> with its compensationHandlers to an atomic transaction: the <scope>
is the body of the transaction, while the compensation is the normal behavior of
a transaction that is forced to roll back (abort). However, you will have noticed
that none of the BPEL elements mention transactions and neither does the OASIS
specication. The reasons for a lack of transactions in BPEL are both technical
and political. As we will see in Chapter 7, the traditional transaction model is
not always appropriate in a long running business process example. As such, other
transaction models (such as those based on forward compensation techniques) may be
more appropriate. Chapter 7 will show that these extended transaction models (and
specications based around them) exist in the area of Web Services. Unfortunately,
none of them have yet become the standard for Web Services transactions.
The original BPEL4WS specication did refer to the IBM, Microsoft and BEA
Web Services Transactions specication. However, since BPEL has entered OASIS,
it has gained a wider audience who are not as ready to jump on the proprietary
IBM, Microsoft and BEA bandwagon of specications in other areas. One proposed
solution in the BPEL standards process was to abstract away from the specics of
a give transaction specication: dene what is required without dening how it is
implemented. The other solution was to remove transactions entirely. Due to time
constraints, at this moment the BPEL committee has settled on the latter solution.
What this means is that BPEL implementations do not have to provide any
transaction support in order to be compliant with the specication. However,
in our experience, when deploying workow systems inter- and intra-enterprise,
some form of transaction support (whether it be traditional ACID transactions or
forward compensation-based transactions) is required. Therefore, it is likely that the
more advanced and enterprise ready BPEL implementations will provide transaction
support over and above what the OASIS specication requires. Obviously this may
affect the portability of any workows implemented.
To help place all of what we have just discussed into context and make it much more
concrete, in the rest of this chapter we will look at a worked example. We will slowly
build up this example, using various aspects of BPEL that we have mentioned, to
illustrate how it can be applied to fairly complex business relationships.
128
Chapter 3: Orchestration
129
be possible to show the full power and exibility of the tools we will use. However, we
hope to give you a avor of what is possible with BPEL and encourage you to explore
this area more. As we have already said, tying together Web Services into process
ows offers a powerful opportunity to leverage existing infrastructural investments
without being tied into one specic vendor.
The example scenario we are going to look at in more depth is the order process
example we have seen throughout this chapter and is illustrated in Figure 3.
Unfortunately, to show how to implement this entire scenario in BPEL, covering all
aspects including failure cases, will take more space than we have available. Therefore,
we will concentrate on one specic aspect of the scenario, the payment authorization
segment, and give an overview of how the rest could be tackled.
4. Design-Time Demonstration
In this section we will look at what it means to design a BPEL application using the
tools available. We will examine the design tool and process execution engine and
explain the fundamental steps in implementing this scenario.
130
As we have already mentioned, to show how all of this scenario could be implemented in BPEL will consume too much space. So, we will concentrate on the
paymentAuthorization task and how it is related to the overall processOrderApplication
service.
Note that in the following examples we are going to use basic Web Service
implementations that do very little in the way of real business process. This is
because we are going to focus on BPEL and how the scripting language can be used to
glue together Web Services. As we mentioned at the start of this chapter, the advantage
of the Service-Oriented Architecture approach to application development is that
the underlying implementations of specic services can change without affecting the
application. Therefore, replacing the basic Web Services with real-world equivalents
is straightforward, but beyond the scope of this chapter because of space limitations.
Chapter 3: Orchestration
131
132
As you can see from the portType, the Web Service that clients interact with has an
input and an output (for simplicity we will model this as a synchronous invocation).
The invocation from the client (input) is expected to carry the clients name, the
name of the item being requested and the delivery address for the order (assuming
that it is allowed and can be fullled). The response to the client (output) will
eventually be a string indicating whether or not the order has been allowed. We will
add error handling later.
Chapter 3: Orchestration
133
This will take as input the clients name and then return a Boolean indicating whether
or not the client is authorized to place the order. How the actual Web Service performs
this validation is an implementation choice and could involve diving down into a
specic programming language such as Java or C#. However, the Collaxa design tool
gives us the exibility of staying entirely within the BPEL domain and we will use
that because it further illustrates the power of BPEL and some of the activities we
previously mentioned.
So, the rst thing we want to do is dene an <assign> activity that will look
at the input message for our PaymentAuthorization service and based on the
contents, determine what the output message will be. We can do this by dragging
and dropping an <assign> activity to after the <receive> activity, but before the
<reply> activity, as shown in Figure 7.
134
Chapter 3: Orchestration
135
136
us to stay entirely in the BPEL world in order to test our ow. Even if we eventually
replace the sample Web Service with one that does authorization in a more realistic
manner, the fact that we can test and validate the required message interaction with
a dummy service means that we can isolate any future problems to the service
implementation or a lack in our requirement specication.
If you are interested in seeing what the equivalent BPEL source is that the design tool
has auto-generated for us, then this is shown in Code 36.
<!-- PaymentAuthorization BPEL Process -->
<process name="PaymentAuthorization"
targetNamespace="http://acm.org/samples"
suppressJoinFailure="yes"
xmlns:tns="http://acm.org/samples"
xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:bpelx="http://schemas.collaxa.com/bpel/extension">
<!-
PARTNERLINKS:List of services participating in this BPEL
process
-->
<partnerLinks>
<!-- The client role represents the requester of
this service. -->
<partnerLink name="client"
partnerLinkType="tns:PaymentAuthorization"
myRole="PaymentAuthorizationProvider"/>
</partnerLinks>
<!-
VARIABLES: List of messages and XML documents used in this
process
-->
<variables>
<!-- Reference to the message passed as input during
initiation -->
<variable name="input"
messageType="tns:PaymentAuthorizationRequestMessage"/>
<!-- Reference to the message that will be returned
to the requester -->
<variable name="output"
messageType="tns:PaymentAuthorizationResponseMessage"/>
</variables>
Chapter 3: Orchestration
137
<!-
ORCHESTRATION LOGIC: Set of activities coordinating the
flow of messages across the services integrated within
this business process
-->
<sequence name="main">
<!-- Receive input from requester.
Note: This maps to operation defined in
PaymentAuthorization.wsdl -->
<receive name="receiveInput" partnerLink="client"
portType="tns:PaymentAuthorization" operation="process"
variable="input" createInstance="yes"/>
<!-- Generate reply to synchronous request -->
<assign name="authorisedResponse">
<copy>
<from expression="starts-with
(bpws:getVariableData( input, payload,
/PaymentAuthorizationRequest ), 1234)">
</from>
<to variable="output" part="payload"
query="/PaymentAuthorizationResponse/result"/>
</copy>
</assign>
<reply name="replyOutput" partnerLink="client"
portType="tns:PaymentAuthorization" operation="process"
variable="output"/>
</sequence>
</process>
Code 36. BPEL language for the PaymentAuthorization service
If we then rerun the example with a valid name (1234goodclient in this case), the
results are as expected, and shown in Figure 10.
Hopefully, at this stage you can see how relatively straightforward it would be to
replace the default PaymentAuthorization Web Service with one that was based
on something more meaningful.
Finally, we will publish our PaymentAuthorization service so that it can be
integrated within the overall business scenario. How the service is made available to
the rest of the world is a deployment choice that will typically be based on a number
of factors, including trust relationships between partners. For example, the WSDL
138
Chapter 3: Orchestration
139
As one can see from Figure 11, initially the <scope> has no fault handlers and does
nothing. However, we can quickly rectify this by putting an <invoke> activity within
the scope. Remember, what we are modeling is the ProcessOrderApplication
process requesting of the PaymentAuthorization task to validate the clients
credentials.
In order to do this with the <invoke> activity, we must dene the partner link
relationship. In the design tool that we are using, once the <invoke> activity has
been installed within the <scope>, a special partner link creation template is made
available for that activity, which is shown in Figure 12. In this template, we rst
dene the name of the partner link (PaymentAuthorizationPartner) and then
give the location of the WSDL for that partner. As you can see, this tool allows us to
specify the WSDL location either explicitly (which we do here), or we could browse
a UDDI registry.
Once the WSDL has been dened, the tool goes and fetches it so that it can
offer us the partnerLinkType and partnerRole denitions. The resultant BPEL
partnerLink denition is shown in Code 37. Once again, this is all automatically
generated by the tool.
140
Chapter 3: Orchestration
141
142
<sequence name="main">
<!-- Receive input from requester.
Note: This maps to operation defined in
ProcessOrderApplication.wsdl -->
<receive name="receiveInput" partnerLink="client"
portType="tns:ProcessOrderApplication" operation="process"
variable="input" createInstance="yes"/>
<!-- Generate reply to synchronous request -->
<scope name="authorization">
<sequence>
<assign name="InitializeClientCredentials">
<copy>
<from variable="input"
part="payload" query="/ProcessOrderApplication/clientName">
</from>
<to variable="clientCredentials"
part="payload"/>
</copy>
</assign>
<invoke
Chapter 3: Orchestration
143
partnerLink="PaymentAuthorizationPartner"
portType="tns:PaymentAuthorisation" name="paymentAuthorization"
inputVariable="clientCredentials"
outputVariable="clientValidation" operation="process"/>
<assign name="ObtainAuthorizationResponse">
<copy>
<from variable="clientValidation"
part="payload">
</from>
<to variable="output"
part="payload"/>
</copy>
</assign>
</sequence>
</scope>
<reply name="replyOutput" partnerLink="client"
portType="tns:ProcessOrderApplication" operation="process"
variable="output"/>
</sequence>
Code 38. The BPEL source for the PaymentAuthorization scope activity
144
catered for within BPEL. In order to model these two types of fault we need
to return to the PaymentAuthorization service and allow it to throw these
two fault types: ClientNameFormatFault and UnpaidBillFault respectively.
Then we go back to the authorization <scope> activity we declared earlier in the
ProcessOrderApplication ow. If we remember from Figure 11, the design tool
shows that the activity has scope for fault handlers as well as a compensation handler
and event handlers (e.g., onMessage). It is relatively straightforward to add two fault
handlers to this scope, one for each of the faults that the PaymentAuthorization
service can now throw. Figure 15 shows the handler for the UnpaidBillFault.
Chapter 3: Orchestration
145
5. Run-Time Demonstration
Now that we have designed our ProcessOrderApplication, we can execute it and
examine what actually happens from one step to another. As we did when designing
it, we will only concentrate on the PaymentAuthorization sub-task for simplicity.
146
Chapter 3: Orchestration
147
148
6. Summary
In this chapter we have looked at the principles behind workow systems and why
they have been used successfully for a variety of enterprise integration strategies.
However, as we saw, the lack of a rigorous standard for workow that concentrated
on interoperability of implementations often resulted in vendor lock-in. Fortunately,
Web services are specically about fostering systems interoperability and the SOA
is deliberately not prescriptive about what happens behind service endpoints: Web
Chapter 3: Orchestration
149
services are ultimately only concerned with the transfer of structured data between
parties, plus any meta-level information to safeguard such transfers.
As a result, combining Web Services and workow offers the best of both worlds: an
interoperable integration strategy that allows you to leverage existing investments. We
then discussed the Business Process Execution Language (BPEL) now in OASIS, but
originally from BEA, IBM and Microsoft, which is a workow scripting language for
specifying business process behavior, based on Web services and is rapidly becoming
the standard for Web Services workow. The language (entirely XML-based) can be
used to formally dene the behavior of business processes and their interactions.
More importantly, BPEL has the potential to commoditize the capabilities provided
by the old workow and proprietary EAI and BPM solutions. This is extremely
important because it should allow integration tasks to leverage existing (legacy)
investments in EAI and provide an integration path between different vendor
implementations.
After discussing the principles behind BPEL we further illustrated the advantages that
it offers by using a worked example (an order process scenario). As we saw, with the
aid of a suitable graphical tool, designing fairly complex process ows using BPEL is
relatively straightforward. With only a few mouse-clicks and a basic understanding
of the BPEL language, we were able to dene the paymentAuthorisation task of our
original processOrder application. What BPEL (and by implication Web Services), its
supporters and implementers have done is to take the once elitist area of workow
systems and bring them to the masses. It is no longer a requirement that specialist
EAI vendors have to be the rst and only port of call for corporations large and small
who wish to automate their internal or external business processes.
4
WORKING WITH
REGISTRY AND UDDI
Look at a day when you are supremely satised at the end. Its not a day when you
lounge around doing nothing, its when youve had everything to do and youve done it!
Margaret Thatcher
The demeanor of conducting business has changed over the past decade. However,
there are certain entities, the real players in a transaction that have remained the same
buyers, sellers and marketplaces. Whether you buy a book over the Internet, shop at the
nearest mall or take advantage of the spa service at your local club, the above entities
hold true. The buyers and sellers meet at a market place where the seller showcases its
products and services. The buyer browses through it, evaluates it and may decide to
perform the transaction. In the context of SOA, a registry resembles a market place.
It provides applications and businesses a central point to store information about
their services. It is expected to provide the same level of information and the same
breadth of services to its clients as that of a conventional market place. However,
the vision of a registry solution does not end here. The dream of the enterprise
architects is to have a solution that facilitates the automated discovery and execution
of e-commerce transactions and enabling a liquid and frictionless environment for
business transactions. Therefore, a registry is more than an e-business directory.
It is an inherent component of the SOA infrastructure that should be mature to
propose pragmatic standards yet exible enough to manage the growing complexity
and dynamism in business relationships and interoperability.
There are more than one industry initiatives to handle the issue of registry. In this
chapter, we will take a look at Universal Description, Discovery and Integration
(UDDI). Before we examine UDDI, it is imperative to understand the role and basic
elements of a registry solution in business transactions.
151
152
153
based on agreed upon standards provides a common way to publish and discover
services. It offers a central place where you query whether a partner has a service that
is compatible with in-house technologies or to nd a list of companies that supports
shipping services on the other side of the globe.
154
155
Microsoft, IBM and Ariba rst proposed the UDDI specications in the year 2000.
By the time version 3.0 of the specications was released in the year 2002, the
UDDI consortium consisted of more than 200 members. Keeping with the spirit of
open standards, the consortium handed over the future UDDI development efforts
to the open-standards organization OASIS. The specications have gone under
signicant evolution since its rst inception. While the initial UDDI specication
focused on Web service description and discovery on an Internet scale, subsequent
UDDI renements helped it become a more effective and pragmatic solution. The
introduction of the subscription API and the means to facilitate the gradual migration
of a service from an internal development setting to the enterprise level registry and
nally to the web is evidence that the specications have matured enough to handle
real world issues.
In simplistic terms, a registry solution can be compared to a phone book. It provides
the ability for service providers to register their services and for service consumers
to easily locate the business entities and the services they provide. Conceptually, a
business can register three types of information into a UDDI registry.
1. White pages
Basic contact information and identies about a company, including business
name, address, contact information and unique identiers such has DUNS or tax
ids. This information allows consumers to locate your serivce based upon your
business identication. This is similar to looking up either the phone number or
address of a business when you know the businesss name.
2. Yellow pages
Yellow pages describe a service using classication information. For instance,
the phone directory can provide information to nd an Italian restaurant in
the San Francisco area. It allows consumers to discover a service based upon its
categorization (taxonomy). We will discuss more about taxonomies later in this
chapter.
3. Green pages
Green pages allow to describe the service that the business offers. They contain
technical information about the behavior, support functions and access point for
the service.
156
UDDI presents a number of APIs such as inquiry API, publisher API and subscriber
API for the consumers to access the registry. The specications also present an
information model composed of instances of persistent data structures called entities.
The core entities are businessEntity, businessService, bindingTemplate
and tModel. Each of the entities are expressed in XML and are persistently stored
by UDDI nodes. A set of services that implements at least one UDDI API set is
termed as a UDDI node. One or more UDDI nodes may form a UDDI registry, with
the restriction that a node may belong to one, and only one, registry. The nodes
of a registry collectively manage a well-dened set of UDDI data. Typically, this is
supported by the use of UDDI replication between the nodes in the registry, which
reside on different systems. The nodes are hosted by operators who are responsible
for durable recording and backup of all data, providing security and maintaining the
integrity of data.
Within a registry, each instance of the core data structures is uniquely identied by a
UDDI key. By choosing appropriate policies, multiple registries may form a group,
known as an afliation, whose purpose is to permit controlled copying of core data
structures among them. In the next few sections, we will examine each of above
concepts in more detail.
157
158
Figure 5. BusinessEntity
159
Figure 6. BusinessService
160
Figure 7. BindingTemplate
161
consider the situation where the company DummyMortgages has a relationship with
several lenders for processing home loan applications, each lender having its own
implementation. Since the service denition requirement for DummyMortgages is
the same for all partners, it could publish the service denition tModel as a standard
for all of its partners. The several lenders can reference the DummyMortgages service
denition and publish their own service implementation details. The concept of
tModel allows various entities like DummyMortgages or standard bodies to publish
abstract service specications that can then be used by other partners that implement
services. By referencing to the tModel, the partners agree to be compliant with the
service specication dictated by the tModel.
Figure 8 lists the elements in the <tModel> structure.
Figure 8. TModel
162
Figure 9. PublisherAssertion
163
earlier versions of UDDI, the registry generated the keys. Version 3 of specications
allows businesses to suggest a key at the time of publishing the entry. With Version
3, the key can be generated either by the registry (UUID/uddiKey), or specied by
the client (domainKey) or a combination of the above two (derivedKey). Let us
examine the various key types.
2.3.1. UUID
Universally unique identier, known as UUID is assigned when the data structure
is rst inserted into a UDDI registry and the user does not specify a key. They
are 16 digit hexadecimal strings and the registry guarantees the generation of a
unique identier by concatenating the current time, hardware address, IP address,
and random number in a specic fashion. An example of a uuid-based registry key is:
uddi: 4CD7E4BC-648B-426D-9936-443EAAC8AE23
2.3.2. DomainKey
domainKey allows the publisher to the register its domain name as part of the key
and in a format that is more palatable for humans to read. Because domain keys
are based on an organizations internet domain name, they also facilitate the aim of
global uniqueness, and allow a business to dene its own policy for generating their
service keys. The following is an example of a valid domain key.
uddi: springer.com
164
2.3.3. DerivedKey
The derived key can be generated by appending a key appending string (KSS) to
a UUID or a domainKey. A KSS may consist of any non-null alphanumeric ASCII
character, as well as a few other special characters. The following listing illustrates a
valid derived key based on UUID.
uddi: 4CD7E4BC-648B-426D-9936-443EAAC8AE23:Enterprise SOA Book
In a similar manner, a derived key can be generated using a domainKey
uddi: springer.com:Enterprise SOA Book
The introduction of domain keys and derived keys makes managing service keys
much more organized. But even with user-specied keys, a UDDI registry still has
to enforce global key uniqueness. When publishing a new registry entry, the UDDI
registry checks with its internal key verication policy if the suggested registry key
is acceptable. If it is, the entry will accept the provided registry key; otherwise, the
UDDI registry will generate a UUID.
Data is only considered information if it can be discovered and used. It is worthless
if it is lost within a mass of other data. If a client application cannot effectively nd
information within a registry, then the purpose of the registry service is considerably
compromised.
Taxonomy The term is derived from the Greek taxis (arrangement) and nomos
(law). It is dened as the science, laws, or principles of classication.
165
2.4.1. Categorization
Categorization allows data in a UDDI registry to be associated with an industry,
product or geographic code set. UDDI facilitates a classication system to be used on
every entity contained in the registry. It is generally recommended that all services be
classied before being made publicly available. You can either use any of categorization
schemes supported by the base specications or create your own.
As part of the base specications, UDDI supports three canonical taxonomies that
be used for categorization of businesses and the services they offer. Each taxonomy
categorization is registered as a <tModel> structure within UDDI. This registration
means that each categorization has a <tModel> name and UUID that can be used to
reference it. Table 1 summarizes the list.
Table 1. Taxonomies
Taxonomy Name
TModel name
Description
NAICS
ntis:gov:naics:1997
UNSPSC
unspsc-org:unspsc:3-1
ISO 3166
iso-ch:3166:1999
The North American Industry Classication system jointly developed by US, Canada and Mexico. Provides classication for services and manufacturing including categories for Dog and Cat
Food, Knit Outerwear and Computer Storage Devices. More information can be found at
http://www.census.gov/epcd/www/naics.html
The Universal Standard Products and Services
Classication provides classication for products
and services for worldwide use. More information can be found at http://www.unspsc.org
International standard geographical regions.
This taxonomy includes codes for countries
and their administrative support staffs.
More information can be found at
http://www.din.de/gremien/nas/nabd/iso3166ma
UDDI registries also allow using your own classication schemes. Sometimes it
is necessary to dened additional classication schemes particularly when you are
dening businesses for internal registries. You could create a new taxonomy based on
price, service or other factors. However, identifying categories for easy searching is
not an easy proposition. Anyone who has ever searched the web for an item should
be familiar with the problem. If the category is too broad, like manufacturing, it can
return countless businesses and services thus overwhelming the client. If the category
166
is too specic, like manufacturing yellow trucks in San Diego, it might be too
restrictive to return any results. UDDI allows multiple classication schemes to be
applied to a single entity. The categories are assigned with the use of <categoryBag>
element that is part of the core UDDI entities.
167
2.4.2. Identiers
Another way to search an entity in the registry is by using a unique key or identier.
UDDI registry has the ability to mark entities with identier. An identier is a
type of property or keyword that can be used to uniquely identify a business or
specication. The purpose is to allow others to nd the published information using
more formal identier systems. For instance, businesses may want to use their DU-N-S number, Global Location Number (GLN), or tax identier in their UDDI
registration data, since these identiers are shared in a public or private community in
order to unambiguously identify businesses. In UDDI registries that are only used in
private communities, businesses may also want to use privately known identiers. For
example, in a UDDI registry that is used as a service registry in a private exchange,
supplier identiers that are only known in this community might be used to identify
the businesses. Identiers can be applied to <businessEntity> and <tModel>
structures.
Identiers and categorizations are implemented similarly. Identiers are attached
to <businessEntity> and <tModel> documents through an <identifierBag>
structure. As illustrated in Figure 12, the <identifierBag> structure can have one
or more <keyedReference> structures that provide the name, value and <tModel>
UUID reference for locating more information.
For example, the following listing can be used to identify Springer publications using
their Dun & Bradstreet D-U-N-S Number and the corresponding tModelKey
within the UDDI Business Registry:
168
<identifierBag>
<keyedReference
tModelKey="uddi:uddi.org:ubr:identifier:dnb.com:d-u-n-s"
keyName="SAP AG"
keyValue="31-626-8655"/>
</identifierBag>
However, as Figure 13 illustrates, more than one identier can be attached to the
entity.
169
3. Programming UDDI
Three of the main API sets supported by UDDI specications are for inquiry,
publishing and subcription. The inquiry API locates information about a business,
the services a business offers, the specications of those services, and information
about what to do in a failuare situation. Any read operation from a UDDI registry uses
of one of the inquiry APIs message. The inquiry API does not require authenticated
access and is subsequently accessed using HTTP.
The publishing API is used to create, store or update information located in a
UDDI registry. All functions in this API require authenticated access to a UDDI
registry; the UDDI registry must have a logon identity, and the security credientials
for this identity must be passed as a parameter of the XML document for each
UDDI invocation. Because publishing requires authenticated access, it is accessed
over HTTPS, with a different URL than the one used with the inquiry access point.
The subscription API, which has been introduced with UDDI v3 as an optional
API allows consumers to register interest in the UDDI registry as a subscription.
Whenever there is change in the registry that matches the subscription criteria, the
register sends a notication to the client.
170
Method Name
Return type
Description
<bindingDetail>
171
Retrun type
Description
<bindingDetail>
172
Most likely, you would use a tool with a graphical interface to achieve the above two
patterns. It should allow you to nd information on the basis of business, service or
tModel and then let you drill down. It should further let you drill deeper, locating
entities in the current context as your navigate through the registry.
173
174
Method Name
Return type
Description
<bindingDetail>
Return Type
Description
175
Return Type
Description
Adds a new relationship assertion to the current set of assertions. A publisher assertion creates
an association between two businesses. The relationship becomes
publicly visible only when both
the businesses have added matching <publisherAssertion> documents to their collection.
delete_publisherAssertions <dispositionReport>
Removes
a
specic
publisherAssertion. Deleting
an assertion causes any relationships
based on that assertion to become
incomplete.
set_publisherAssertions
<publisherAssertions> Saves a new complete set of
assertions for a publisher, completely replacing any previous
assertions. The call returns a
<publisherAssertions> document that contains the current
collection as they are stored in the
registry.
add_publisherAssertions
<dispositionReport>
Return Type
Description
176
Let us illustrate the use of the above API by imagining a company, DummyMortgages,
which provides a brokerage solution for home mortgages. Consumers or Mortgage
buyers provide basic information about the type of loan required, and DummyMortgages supplies the best interest rate as available from its partners. DummyMortgages
deals with many banks and nancial institutions on a routine basis as increasing
its partners network and providing the best interest rate for its customers is critical
to its business growth. In order to integrate with its system, DummyMortgages
asks its partners to implement a mortgage query service. The service would take
the amount, and type of loan as the arguments and return the available interest
rate. DummyMortgages publishes the interface denition of the expected service
at its partners website so that a potential partner can implement the service and
register it with the companys UDDI service. On a periodic basis, DummyMortgages
business team queries the UDDI registry for a list of services that have implemented
the mortgage query interface. If the list returns a new partner, the business team
adds the name to its existing directory of partners. And from this point on, any
consumer request for a loan will also be forwarded to this newly founded partner. The
subscription API allows DummyMortgages to register its interest with the UDDI
registry. Figure 14 illustrates the scenario.
177
on how and when to notify the DummyMortgages business team. It also allows
specifying the length of time that the company is interested in monitoring the registry
changes. The query and preferences are stored in the subscription structure that
is shown in Figure 15. The subscription API supports two monitoring patterns.
178
Note that the subscription API is optional and the UDDI registry is not required to
support it. Table 8 lists the methods dened by the specication.
Return Type
Description
<DispositionReport>
179
4. Internationalization
The U in UDDI stands for Universal and the one of the goals is to provide a registry
solution for Universal description, discovery and integration of business entities and
their services. The UDDI registry design includes support for internationalization
features. Most of these internationalization features are directly exposed to end users
through the API sets. Others are built into the design in order to enable the use of
the UDDI registry as an international services discovery and description mechanism
with multilingual descriptions of business entities worldwide. Version 3 of the UDDI
specications supports the ability to classify entities using multiple languages and
multiple scripts of the same language. It also allows for additional language-specic
sort orders and provides for consistent search results in a language-independent
manner.
This section discusses the internationalization features supported by the UDDI
specications:
multilingual descriptions, names and addresses;
multiple names in the same language;
internationalized address format; and
language-dependent collation.
180
181
and also the use of acronym. In the example, the rst <name> element is the
primary name of the business (a Japanese ower shop) in Japanese Kanji. The second
<name> element is the business name transliterated into Japanese Katakana. The
third <name> element gives the business full English name, and the fourth <name>
element gives its English acronym:
<businessEntity ...>
........
<name xml:lang="ja">???):</name>
<name xml:lang="ja">......</name>
<name xml:lang="en">ShippingRUs</name>
<name xml:lang="en">SRU</name>
.....
</businessEntity>
Where multiple name elements are published, the rst name element is treated as the
primary name, which is the name by which a business would be searched and sorted
in case the business has multiple names.
182
With the use of the keyName/KeyValue pair together with the codes assigned in the
ubr-uddi-org:postalAddress tModel, you can programmatically determine
the address semantics and evaluate them even if the sub-elements are specied in
different sequence or language.
Since there is large variation in address sub-elements of different countries, the address
structure also supports free form address lines.
183
another and how global registry key uniqueness is maintained. In the earlier versions
of UDDI specications, only the UDDI node could generate keys and a publisher
was not allowed to pre-assign the keys. In order to maintain the uniqueness of keys, a
publisher could not import or export a UDDI registry entity in its entirety from one
registry to another.
As we discussed earlier in this chapter, Version 3 of UDDI approaches the issue of
key generation in a signicantly different fashion and it allows the publisher to use its
own keys while registering an entity. It therefore allows copying an entity from one
registry to another while preserving the key. This behavior is called entity promotion
and it permits data sharing between UDDI registries and it establishes UDDI as
a more distributed registry solution. The publisher could potentially publish the
entirety of a registrys contents into another registry, effectively mirroring the data.
Or, the publisher might be interested in only a subset of data from another registry
and only copy a portion of that data. However, while copying the entities across the
registries, it is still critical to avoid key collisions. The recommended way to prevent
such collisions is to establish a root registry, a registry that acts as the authority for
key spaces. A root registry serves to delegate key partitions such that other registries
can rely upon the root registry for verication and validation of a given key partition.
All other registries that interact with the root registry are called afliate registries. By
relying on a common root registry as an arbitrator of key spaces, afliate registries can
share data with both the root registry and among one another with the knowledge
that a given partition is unique.
An important example of a root registry is the UDDI Business Registry, which
has a set of policies in place to generate unique uuidKeys as well as to validate
domainKeys through signatures that correlate with DNS records. By acknowledging
the UDDI Business Registry as a root, an afliate registry can establish inter-registry
communication policies and procedures with both the UDDI Business Registry and
any other registry, which is an afliate of the UDDI Business Registry. Following this
approach, registries could form hierarchical relationships where they can share data
with their parents and afliate registries and form a federation.
The two scenarios below illustrate the use of inter-registry communication in real
business situations.
184
185
186
4.8. Security
The security model for a UDDI registry can be characterized by the collection of
registry and node policies and the implementation of these policies by a UDDI
node. The principal areas of security policies and mechanisms in the UDDI
specication are related to data management, user identication, user authentication,
user authorization, condentiality of messages and integrity of data.
UDDI v3 also supports XML Digital Signatures on UDDI data. XML digital
signature is discussed in depth in the next chapter on Security. In the context of
UDDI, it enables consumers to verify the integrity of the data with respect to the
publisher. Publishers of entities can now ensure that some malicious party who claims
187
to own the entity does not misrepresent them. Furthermore, once a publisher signs
the data, altering it in any way breaks the signature, providing condence in the datas
integrity. By verifying the signature, consumers using the registry can also be assured
that a signed entity is valid and that the publisher represented by the signature created
it. Consumers can also issue queries that only return results pertaining to signed
data. The reliability of data is even more critical in the multi-registry environment.
When signed data is copied between registries, you can guarantee its integrity by
simply validating the signature. The use of digital signatures improves both the
quality of data in UDDI and provides users with the trust and protection needed for
service-oriented applications.
5. Summary
A registry solution is all about sharing business information, making it easier to publish
your preferred means of doing business, nding trading partners and have them nd
you, and interoperate with these trading partners over the internet. It removes the
barriers to rapid participation in the global economy and allows businesses to fully
participate in the new digital economy. The automated application-to-application
discovery and integration over the Internet helps eliminate many of the conguration
and compatibility problems that are preventing businesses from more widely adopting
B2B, despite B2Bs potential for cost savings and improved efciency. However, just
like the early days of web, the registries have a Catch 22 situation. Users and businesses
will not search the registries if there are not many services listed in the registry. With
the scarcity of potential consumers, the providers will be reluctant to put the extra
effort required to publish a service in the registry. The initial idea of the architects
was to have a global registry where everybody can publish their services, but this has
changed and the industry is now seeing many private and shared registries being used
within the partner networks.
However, there are still a lot of places, where in spite of the service enablement of
the business functions, the requestor and the provider binds directly to each other.
True ESOA is only achieved when your organization accomplishes the dynamic
interoperability between services. When the provider can announce a service and
does not have to communicate individually with all the users. And a business analyst
can select a service based on the functionality without worrying about the underlying
infrastructure. There are a few key points that strongly support the value of a registry
solution in an ESOA environment:
Visibility: Without a registry solution, the business user or client cannot nd
what is available. You cannot use what you cannot nd. The architects and
188
Re-usability: It is one of the keys to the success of ESOA. The extra investment
in enabling your business functions as services pays off, when it helps in avoiding
the duplicate effort within the enterprise. However, without a registry solution,
participants involved in creating, managing and consuming services will not
know what others are planning and building and this will result in redundant,
conicting and overlapping services within the enterprise.
Congurability and Adaptability: Registry provides a layer of abstraction
between the consumer and the service provider. It allows for the modications
in the business requirements, policies or needs of the consumer as well as the
implementation changes of the provider without affecting each other. It allows
enterprises to assert new policies that dene specic security, process, semantic,
and governance constraints by which consumers can bind to specic business
services, and for clients to adapt without having to redeploy applications.
The APIs provided by the registry solutions allows random searching for businesses.
It is conceivable that software will eventually discover a service dynamically and use
it without requiring human interaction. In the near future, the business analysts
with specic knowledge of the problem at hand will use UDDI portals to discover
potentially interesting services and partners, and technologists will write programs to
use the services from companies that have already been discovered. UDDI portals
and SOA management solutions are coming up fast in the market that provides
user friendly interfaces and not only allows customized searches for business but also
provides support to update information in a registry.
5
UNDERSTANDING
ENTERPRISE SECURITY
The difculties you meet will resolve themselves as you advance. Proceed,
and light will dawn and shine with increasing clearness on your path.
Jim Rohn, Author of The Art of Exceptional Living
190
191
192
attribute of a header entry is used to indicate the URI of an intermediary who will
process the header entry.
193
2. Security Concepts
Technologies designed to meet the security requirements have evolved and have come
a long way. However, the requirements have remained relatively constant. The risks
of a system without a security infrastructure have not changed:
194
195
196
Not exactly an absolute requirement but other useful features in the security
infrastructure are given below.
3. Security Technologies
With the growing acceptance of XML as de facto language for documents and
protocols, it is only logical that security should be integrated with XML solutions.
There are a number of XML Security standards to handle the security needs of
service-oriented applications. These standards use legacy cryptographic and security
technologies, as well as emerging XML technologies, to provide a exible, extensible
and practical solution toward meeting security requirements.
Figure 3 displays the building blocks required for the security framework.
The following items will be discussed in this chapter.
Security Tokens.
XML Digital Signature for integrity, Nonrepudiation and signing solutions.
XML Encryption for condentiality.
XML Key Management (XKMS) for public key registration, location and
validation.
197
198
you need a passport to prove your identity. Both the drivers license and passport
are credentials to vouch for your identity. However these documents do not perform
authentication. Authentication is performed by a person based on these credentials.
The bank teller or the immigration ofcer will verify the picture, signature or other
attributes of these documents and validate that you are the rightful owner. In the
software world, security tokens serves the purpose of drivers license or passport. Like
the license bureau or passport authority, there are security token service providers that
can issue security tokens that can be used by applications. The service provider will
accept these tokens as part of the request and perform authentication before serving
the request.
The requestor can send a security token along with the data as a proof if its identity.
Security token is dened as a representation of security-related information (e.g.
X.509 certicate, Kerberos tickets and authenticators, username, etc.). A security
token is considered signed that contains a set of related claims cryptographically
endorsed by an issuer. Examples of signed security tokens include X.509 certicates
and Kerberos tickets. Username/password is considered unsigned security tokens.
The requestor and provider can either have their own implementations to support
the security token or they can rely on an external security token service. Figure 4
illustrates a common message ow.
3.1.1. Username/Password
The most common ways to pass around credentials is to use a username and password.
The password can be sent along with the message in plain text or as a digest hash.
The other option is to communicate the password in advance to avoid sending it
with the message.
199
3.1.3. Kerberos
To use Kerberos, a user presents a set of credentials such as username/password or
an X.509 certcate. The security system them grants the user a ticket granting ticket
(TGT). The TGT is an opaque piece of data that the user cannot read but must
present in order to access other resources. The user will typically present the TGT in
order to get a service ticket (ST). The way the system works is as follows:
1. A client authenticates to a Key Distribution Center (KDC) and is granted a
TGT.
2. The client takes the TGT and uses it to access a Ticket Granting Service (TGS)
3. The client requests an ST for a particular network resource. The TGS then issues
the ST to the client.
4. The client presents the ST to the network resource and begins accessing the
resource with the permissions the ST indicated.
200
a one-way hash mechanism to generate a message digest for the actual content. Once
created, it is not possible to change a message digest back into the original data from
which it was created. The second step is to encrypt the message digest and create a
signature. While sending the data, the sender appends the signature with the message
data.
201
202
203
This process is necessary because for digital signatures to work, each partys
view of the signed document must be identical bit-for-bit. Canonicalization
transforms an XML document into a standard form, ensuring that both parties
view a document in the exact same way before signing it. We will look more
into Canonicalization in a little bit.
<SignatureMethod> identies the algorithm used to create the digital signature. Both the XML Signature standard and WS-Security require support for
the Digital Signature Standard, which uses Secure Hash Algorithm (SHA)-1 to
create a message digest together with the DSA algorithm, and also recommend
support for using SHA-1 together with the RSA algorithm.
<Reference> identies the information being signed, along with any transformations that were applied to it. When used with SOAP, this part of the
signature typically references the signed parts of this SOAP message, such
as the body and parts of the header. The Reference element also contains
the two subelements: <DigestMethod> and <DigestValue>. The rst of
these identies the algorithm used to create the message digest for this digital
signature, while the second contains the message digest value itself.
<SignatureValue>: This element contains the actual signature. As signatures
are always binary data, XML DSIG species that the signature value is always a
simple element with Base64-encoded content
<KeyInfo> indicates what key should be used to validate this signature. The
key can be identied in a variety of ways, such as referencing a certicate that
contains the appropriate public key. This element can even be omitted entirely,
since the recipient may know what key to use by some other means.
<dsig:Object> element contains the actual data that is being sent and used in
creating the digest.
The following example illustrates how XML Signatures work. We are using IBMs
XML Security Suite to generate and verify the signature. The following listing displays
the document order.xml that we will using in the next few examples:
<OrderData id="123">
<CustomerData>
<FirstName>John</FirstName>
<LastName>Doe</LastName>
<BillingData>
<Street>123 MainStreet</Street>
<City>Denver</City>
<State>Colorado</State>
204
<Country>US</Country>
<ZipCode>80021</ZipCode>
</BillingData>
<ShippingData>
<Street>123 MainStreet</Street>
<City>Denver</City>
<State>Colorado</State>
<Country>US</Country>
<ZipCode>80021</ZipCode>
</ShippingData>
<Payment Data>
<CreditCardData>
<Name>John Doe</Name>
<Number>122324211234343</Number>
<Issuer>AmericanExpress</Issuer>
<Expiry>20040405</Expiry>
</CreditCardData>
</PaymentData>
</CustomerData>
<ItemData>
<Name>Enterprise SOA</Name>
<Type>Book</Type>
<Reference>83761761</Reference>
<Quantity>1</Quantity>
<Price>44.95</Price>
</ItemData>
</Order>
205
L = Location
S = State
C = Country
alias = Alias for this certificate
storepass = Password for the key store
keypass = Pasword for the private key
3.3.2. Signing
To create digital signatures, we use the SampleSign2 application that is shipped with
the IBMs XML Security Suite. The sample application can be used to create both
detached and enveloping signatures. The application can be used as
java dsig.SampleSign2 <your-alias> <your-storepassword>
<your-keypassword>
<resource><resource> ... > signature.xml
where resource is
-ext URL for an external resource;
-embxml URL for an embedded XML resource (content of specied URL is
embedded in the signature).
Here is how order.xml is signed to generate signature.xml:
java dsig.SampleSign2 john password security -embxml
file:///d:/tools/xss4j/samples/order.xml > signature.xml
The alias, store password and key password are the ones that were generated in the
previous step. The output is directed to a signature.xml, which will have the
signature and the embedded data.
The following listing shows the content of the le signature.xml.
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod
Algorithm="http://www.w3.org/TR/2001/
REC-xml-c14n-20010315">
</CanonicalizationMethod>
<SignatureMethod
Algorithm="http://www.w3.org/2000/09/
xmldsig#dsa-sha1">
206
</SignatureMethod>
<Reference URI="#Res0">
<Transforms>
<Transform
Algorithm="http://www.w3.org/TR/2001/
REC-xml-c14n-20010315">
</Transform>
</Transforms>
<DigestMethod
Algorithm="http://www.w3.org/2000/09/
xmldsig#sha1">
</DigestMethod>
<DigestValue>aJH0LRYgJaAtuqC/PJ/wfFiEI2A=
</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue>
XJjZ7OwwGn9Zhyga/t4ipuFKOnhREqX9UIDUaA2sPJVmhw+y3BksMA==
</SignatureValue>
<KeyInfo>
<KeyValue>
<DSAKeyValue>
<P>/X9TgR11EilS30qcLuzk5?</P>
<Q>l2BQjxUjC8yykrmCouuEC/BYHPU=</Q>
<G>9+GghdabPd7LvKtcNrhXuXmUr7?</G>
<Y>NTijOltictv5/SCbDZhUwKNlGlIOH?</Y>
</DSAKeyValue>
</KeyValue>
<X509Data>
<X509IssuerSerial>
<X509IssuerName>
CN=John Doe,OU=Enterprise SOA Book,
O=Manning,L=Denver,ST=Colorado,C=US
</X509IssuerName>
<X509SerialNumber>1079744797</X509SerialNumber>
</X509IssuerSerial>
<X509SubjectName>
CN=John Doe,OU=Enterprise SOA Book,
O=Manning,L=Denver,ST=Colorado,C=US
</X509SubjectName>
<X509Certificate>
MIIDHDCCAtoCBEBbmR0wCwYHKoZIzjg?
207
</X509Certificate>
</X509Data>
</KeyInfo>
<dsig:Object xmlns=""
xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" Id="Res0">
<OrderData id="123">
<CustomerData>
...
</CustomerData>
</OrderData>
</dsig:Object>
</Signature>
The actual signed data is underneath the dsig:Object. As we will see in the next
section, any alteration with the data will result in a verication failure.
3.3.3. Verication
The XML Security Suite provides a utility, VerifyGUI that reports validity of each
resource and validity of the signature. You can check a given signature to ensure that
the signed resource has not changed, and you can check that the signature matches
the information in the senders certicate.
java dsig.VerifyGUI < signature.xml
If the signature and all of signed resources were not modied, VerifyGUI reports the
result of verication as Core Validity: OK.
208
If the signed le is changed, the signature will no longer be valid. To illustrate this,
change the order id in the signature.xml to 234 and again run the utility. This
time, VerifyGUI reports as Core Validity: NG Digest Value mismatch.
3.4. Canonicalization
XML documents can have the same logical meaning but different physical implementations based on several characteristics such as character encoding, attribute ordering
or white spaces. Digital signature checks whether a message has changed along the
way, but an XML documents physical representation can change during processing,
even though its information content remains the same.
Let us examine the snippets below:
<OrderData id="123" type="web">
<BillingData/>
</OrderData>
and
<order type="web" id="123">
<BillingData>
</BillingData>
</order>
Though both snippets have identical information content, because of their permissible
differences, their digests will denitely differ. XML Canonicalization solves this
209
210
decryption involve a different key where in a two-way encryption, the same key is
used for both operations.
211
212
encrypting the data contents of the message, and the various parties will only be able
to read the data that is meant for them.
Like everything else in the ESOA space, there is an XML solution to address the issue
of encryption. The W3C and IETF have published a specication for encryption:
XML Encryption.
213
214
elements contain information about the key, how it has been encrypted and the
encrypted value.
The following example demonstrates the use of XML Encryption. As in the previous
section, we use IBMs XML Security Suite for the task. We will also reuse the
certicate keys generated in the earlier section on XML Signature.
3.6.1. Encryption
We use the DomCipher application that is shipped with the IBMs XML Security
Suite. The sample application can be used to create both detached and enveloping
signatures. The application can be used as
java enc.DomCipher -e <provider> <keyinfo> <target>
[xpath template...]
//Encryption
and
java enc.DomCipher -d <provider> <keyinfo> <target>
[xpath template...]
//Decryption
Here is how to encrypt order.xml
java enc.DOMCipher -e "*" john security password
file:///d:/tools/xss4j/samples/order.xml > encrypted.xml
The alias, store password and key password are the ones that were generated in the
previous step. The output is directed to an encrypted.xml.
The application also allows us to encrypt parts of data. For instance, the following
command will only encrypts the credit info in the order.xml
java enc.DOMCipher -e "*" john security password
file:///d:/tools/xss4j/samples/order.xml
"//*[name()=CreditCardData]" >
encrypted.xml
3.6.2. Decryption
The XML Security Suite provides a utility, VerifyGUI that reports validity of each
resource and validity of the signature. You can check a given signature to ensure that
215
the signed resource has not changed, and you can check that the signature matches
the information in the senders certicate.
Here is how to decrypt encrypted.xml:
java enc.DOMCipher -d "*" john security password
file:///d:/tools/xss4j/samples/encrypted.xml > order.xml
3.7. Authorization
Security tokens provide a way of authentication and establish your identity. However,
authentication does not allow you to perform a specic action or to access a resource.
For instance, you can login into a database system using your login id and password.
It will let you navigate around the tables and read the data but you will not be
allowed to delete a table unless you are a DBA. Similarly, your credit card will prove
your identity and who you are but you may not be allowed to make a million dollar
transaction through it due to the policy of your credit card company. In a software
language, a policy refers to the set of conditions and constraints that must be met in
order for an entity to perform some type of operation. The requester can be a person
or another application but it has to abide by the policies of the provider to be able to
access its services. Extensible Access Control Markup Language (XACML) provides
XML documents with support for dening access control and policies.
216
attributes, the resource in question, the action, and other information pertaining to
the request. The PEP will then delegate the authorization decision to the PDP. Policy
Decision Point will look at the request and the policy that applies to the request, and
come up with an answer about whether access should be granted.
217
sends encrypted documents to service B, which uses an SPKI solution, then service
B will not be able to decrypt and use the document sent by A. For A and B to work
together, one of them has to understand the others PKI solution. If you extrapolate
this scenario to a situation where multiple partners are involved, it becomes clear that
all of the partners will have to be aware of each others PKI solution, thus increasing
each applications complexity many times.
The XML Key Management Specication (XKMS), another W3C standard aims
to provide a standard XML-based solution for the management of keys for
authentication, encryption and digital signature services.
218
219
products use an intermediary process that controls and manages the passing of user
credentials from one application to another. The responsibility of authentication
and authorization is shifted to a third party, leaving the application free to focus on
implementation of business logic.
The implementation of SSO varies a bit according to the business scenario. In an
ETrade like banking environment, the user can log into one module (say mortgage),
and the system uses SSO to enable the user in other modules as banking, securities
and options. If the user signs off from any of the module, the system signs off the
user from all the other modules. The situation is a bit different in a scenario where
there are more disparate applications participating in the SSO solution. Corporate
intranet, that provides links to other internal sites such as HR and Payroll is a good
example. When the user log in the intranet, he might not realize that he is also login
into other secure sites like Payroll that are SSO enabled. This can pose a security risk
if the user leaves his machine unlocked for an extended period of time. One solution
is to implement a short SSO timeout that mitigates the risk of unauthorized access
to sensitive applications.. The decision to enable an application for SSO lies with the
business. But there are considerations like mentioned above that should be taken into
account before enabling an application. One approach to handle the above issue is by
implementing security levels. The enterprise security group can divide applications
into security levels based on the applications sensitivity. The SSO is enabled within
the security level. Therefore, if the user login into the intranet (with Security level
0), he has to login again to access the Payroll information which is set at a higher
security level.
In ESOA, single sign-on is a subset of a bigger issue referred as identity management.
Single sign-on only deals with username/password. However, each user has an identity
and username/password can be considered as two of the many attributes that are
associated with the identity. One of the approaches seen in SSO implementation is
the use of attributes to dynamically determine the users access or authorization. Thus
when the user logs in, the SSO application (e.g. Netegrity) authenticates the user
against the company directory server and populates the users principal with selected
attributes. The various business applications can then implement a message handler
that can intercept the request and assign dynamic roles based on the attributes in the
request. For instance, if the manager attribute is set to true, the user is allowed
to view the payroll information of other employees. With this implementation, the
SSO application is only used for authentication, and the authorization decisions are
made within the applications domain.
220
221
222
Multiple systems (e.g. Credit Card company, Phone Company), coordinating user
authentication decisions presents another challenge. The information about the
authenticated user needs to be exchanged between trusting service providers. First,
a user or a subject is likely to maintain different local identities with different
service providers. For instance John Doe may be referred as jdoe with the phone
company and johnd with the cable company. Similarly each system has its own way of
expressing security assertions. The successful adoption of Single sign-on and identity
management solutions required a common way to express assertion so that they can
be shared between trusting parties. That need led to the development of an XML
language to express security assertions, the Security Assertions Markup Language, or
SAML. SAML itself is a merger of two previously competing XML-based languages
aimed to specify security-related information, S2ML and AuthML. Currently, SAML
is careering through the OASIS (Organization for the Advancement of Structured
Information) open standards consortium and is poised to become the dominant
security-specic XML language. The next section explains the language in more
detail.
223
224
<saml:Subject>
<saml:NameIdentifier
SecurityDomain="Enterprise SOA"
Name="JohnDoe"/>
</saml:Subject>
</saml:AuthenticatationQuery>
</saml:Request>
In the above listing, the requesting party creates a assertion query for the subject
JohnDoe in the Enterprise SOA Domain. The next listing shows the SAML
response.
<saml:Response MajorVersion="1" MinorVersion="0"
InResponseTo="123" StatusCode="Success">
<saml:Assertion MajorVersion="1" MinorVersion="0"
AssertionID="123"
Issuer="Enterprise SOA"
IssueInstant="2004-03-22T05:45:00Z">
<saml:Conditions
<NotBefore="2004-03-22T05:45:00Z"
<NotAfter="2004-03-22T09:45:00Z">
</saml:Conditions>
<saml:AuthenticationStatement
AuthenticationMethod="Password"
AuthenticationInstant="2004-03-22T05:45:00Z">
<saml:Subject>
<saml:NameIdentifier
SecurityDomain="Enterprise SOA"
Name="JohnDoe"/>
<saml:Subject>
</saml:AuthenticationStatement>
</saml:Assertion>
</saml:Response>
<Conditions> element species the conditions that must be considered when
evaluating the assertion. For instance, in the above listing assertion is only valid
for a specied time period. The statement types can be AuthenticationStatment,
AuthorizationDecisionStatement or AttributeStatement. In the above
listing, it is AuthenticationStatement and it states that the subject JohnDoe was
authenticated at a certain time and it was authenticated using password authentication.
Many of the known industry players in the world of SOA Security (IBM, Microsoft,
BEA, RSA) collectively proposed a number of new web services specications related
225
to security. We have reasons to believe that the intention is not just to cure the
insomniacs. The goal for these specications is to make it easier to apply business
polices and to implement security for a wider range of applications. None of these
specications are an attempt to invent new security solutions but rather use the
existing ones to work along with web services. In the next section, we will look at the
some of most commons one.
226
The security header element allows any XML element or attribute to live within it.
This allows the header to adapt to whatever security mechanisms your application
needs.
WS-Security needs this type of structure because of what the header must do. It must
be able to carry multiple security tokens to identify the callers rights and identity. If
the message is signed, the header must contain information about how it was signed
and where the information regarding the key is stored. The key may be in the message
or stored elsewhere and merely referenced. Finally, information about encryption
must also be able to be carried in this header. In an ESOA application, the same
message ows through a number of intermediaries and endpoints. For each of these
components, the SOAP message can have multiple security headers identied by a
unique actor. The actor attribute in any SOAP header is meant to say this header
is meant for any endpoint acting in the capacity indicated by the actor URI. This
means that the intermediary may act in varying capacities and may consume zero,
one or more headers. Let us look at some examples of how WS-Security can be used
to exchange security information.
227
<wsse:BinarySecurityToken
ValueType="wsse:X509v3"
EncodingType="wsse:Base64Binary"
Id="SecurityToken-f32456fasdfft62......"
</wsse:BinarySecurityToken >
The valueType may be any of the following values, dened by the ValueTypeEnum
in the WS-Security schema document:
wsse:X509v3: An X.509, version 3 certicate.
wsse:Kerberossv5TGT: A ticket granting ticket as dened by Section 5.3.1 of
the Kerberos specication.
wsse:kerberossv5ST: A service ticket as dened by Section 5.3.1 of the Kerberos
specication.
The EncodingType attribute indicates the encoding method and can be set to either
wsse:Base64Binary or wsse:HexBinary.
4.2. Signature
Message integrity is provided by leveraging XML Signature in conjunction with
security tokens (which may contain or imply key data) to ensure that messages
are transmitted without modications. The integrity mechanisms are designed to
support multiple signatures, potentially by multiple actors, and to be extensible to
support additional signature formats. The following listing displays a sample signed
SOAP message.
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext"
xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility">
<s:Header>
<wsse:Security>
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:SignedInfo>
<ds:CanonicalizationMethod
Algorithm="http://www.w3.org/2001/10/xml-exc-c14N"/>
<ds:SignatureMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<ds:Reference URI="#MessageBody">
228
<ds:DigestMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<ds:DigestValue>
aObd89l4kjfdsi...
</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>
jlkfds90dfl...
</ds:SignatureValue>
<ds:KeyInfo>
<wsse:SecurityTokenReference>
<wsse:Reference URI="#X509Cert"/>
</wsse:SecurityTokenReference>
</ds:KeyInfo>
</ds:Signature>
</wsse:Security>
</s:Header>
<s:Body wsu:Id="MessageBody">
...
</s:Body>
</s:Envelope>
4.3. Encryption
In the same way they addressed the question of integrity, the authors of WS-Security
chose to build on existing standards (XML Encryption) for condentiality rather
than create something new. The following listing shows an example of encrypted
message:
<s:Envelope
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
<s:Body>
<xenc:EncryptedData>
<EncryptionMethod
Algorithm=http://www.w3.org/2001/04/xmlenc#tripledes-cbc/>
<ds:KeyInfo>
<ds:KeyName>
CN=ESOA, C=US
229
</ds:KeyName>
</ds:KeyInfo>
<xenc:CipherData>
<xenc:CipherValue>
r5Kipsslkr490dDV ...
</xenc:CipherValue>
</xenc:CipherData>
</xenc:EncryptedData>
</s:Body>
</s:Envelope>
As we mentioned earlier in this section, the purpose of WS-Security standard is not
to invent new standards for security but to use the existing ones. It achieves that be
dening a SOAP security header and thus providing a standard place to list security
artifacts. The following listing represents a consolidated basic WS-Security SOAP
Header:
<s:Envelope>
<s:Header>
</wsse:Security>
<!-- Security Token -->
<wsse:UsernameToken>
...
</wsse:UsernameToken>
<!-- XML Signature -->
<ds:Signature>
...
</ds:Signature>
<!-- XML Encryption -->
<xenc:ReferenceList>
<xenc:DataReference URI="#body"/>
<xenc:ReferenceList>
</wsse:Security>
</s:Header>
<s:Body>
<xenc:EncryptedData>
<EncryptionMethod
Algorithm=http://www.w3.org/2001/04/xmlenc#tripledes-cbc/>
...
230
</xenc:EncryptedData>
</s:Body>
</s:Envelope>
WS-Security standard form a foundation upon which several other security specications rely on. The vision is to have several security components, each addressing a
unique security puzzle to work in unison with each other. The dream is still far from
reality but WS-Security provides a framework to support this unifying approach.
Figure 17 depicts the other security standards that are being built on the WS-Security
foundation.
5. WS-Policy
The Web Services Policy Framework (WS-Policy) is a specication jointly developed
by IBM, Microsoft, BEA and SAP. It species how senders and receivers can state
their requirements and capabilities regarding policies they require to conduct business
in an electronic format. The specication is highly exible and supports an extensible
grammar for expressing the capabilities, requirements and general characteristics
of entities in an XML Web Services-based system. It denes a framework and a
model for the expression of these properties as policies. A policy is expressed as
policy assertions. A policy assertion represents a capability or a requirement. Policy
assertions are dened in a companion specication (Web Services Policy Assertions
231
6. WS-Trust
The Web Services Trust Language (WS-Trust) is a specication jointly developed by
IBM, Microsoft, Verisign, and RSA. In order for a secure communication between
two parties, they must exchange security credentials (either directly or indirectly).
However, each party needs to determine if they can trust the asserted credentials
of the other party. WS-Trust specications describe the model for establishing both
direct and brokered trust relationships (including third parties and intermediaries).
It provides a framework to support:
methods for issuing and exchanging security tokens, and
232
7. WS-Privacy
Personal information becomes public in many ways. For instance, sharing of customer
data among partner companies, unsecured personal information stored on the
internet. WS-Privacy allows organizations to state their privacy policies and require
that incoming requests make claims about the initiators adherence to these policies.
The specication describes a model for how a privacy language may be embedded
into WS-Policy descriptions and how WS-Security may be used to associate privacy
claims with a message. WS-Privacy also describes how WS-Trust mechanisms can be
used to evaluate privacy claims for organizational practice as well as user preferences.
As many governments pass laws to protect sharing of personal information, this
specication will grow in importance.
8. WS-SecureConversation
WS-SecureConversation jointly proposed by IBM, Microsoft, RSA and Verisign,
describe how to manage and authenticate message exchanges between parties
including security context exchange and establishing and deriving session keys.
WS-SecureConveration is the SOAP layer equivalent of SSL at the transport layer.
The mechanisms dened in WS-Security provide the basic mechanisms on top
of which secure messaging can be dened. WS-Security is well suited for a single
message authentication model in which the message contains all the security attributes
necessary to authenticate itself. However, for multi-message conversation, this model
becomes inefcient since each message has to go through the same authentication /
verication process. Parties that wish to exchange multiple messages typically establish
a secure security context in which to exchange multiple messages. A security context
is shared among the communicating parties for the lifetime of a communications
association. WS-SecureConversation specication denes extensions to allow security
233
context establishment and sharing, session key derivation. The primary goals of this
specication are:
Dene how security contexts are established, and
Specify how derived keys are computed and passed.
9. WS-Federation
Web Services Federation Language (WS-Federation) is a specication jointly being
developed by IBM, Microsoft, BEA, Verisign and RSA. It will provide support for
secure propagation of identity, attribute, authentication, and authorization information. The specications describe how to manage and broker the trust relationships
in a heterogeneous federated environment including support for federated identities.
WS-Federation addresses the issue where the requestor in one trust domain interacts
with a service in another trust domain using different security models. For instance,
how does a consumer service using Kerberos invoke a producer service based on
X.509 in a trusted fashion. Liberty Alliance project and Microsoft Passport are an
attempt to solve the same issue and WS-Federation is working towards providing a
standard, generic approach to handle identity federation.
10. WS-Authorization
WS-Authorization specications describe how to manage authorization data and
authorization policies. It covers the description of how assertions can be made
within security tokens as well as how they will be interpreted by each endpoint.
This specication is designed to be exible and extensible with respect to both
authorization format and authorization language. This is important because each
security provider may have a different authorization format and language.
11. Summary
The loosely coupled nature of ESOA systems makes it easy for applications to
interoperate but it also opens the door for unauthorized access. The fragmented
234
nature of ESOA systems only adds to the problem. With a lot of industry momentum
behind ESOA, practical implementations have started to emerge in the market place
and companies have begun to realize the need and complexity of security around
these systems. The security standards mentioned in this chapter are essential for the
successful adoption of ESOA. Many of the specications are still in early stages and
it will take time for the vendors to catch up and provide robust implementations
around these specications. On the plus side, the proposed architecture is exible
enough and does not require a change to the existing security implementations.
6
SOA MANAGEMENT
Management means, in the last analysis, the substitution of thought
for brawn and muscle, of knowledge for folkways and superstition, and of
cooperation for force. It means the substitution of responsibility for
obedience to rank, and of authority of performance for the authority of rank
Peter Drucker
236
1. Problem Space
In previous chapters, you learned that a fundamental element of an SOA is the
contract which is a rst class citizen and which serves to dene the syntax of a service.
The contract also describes semantics of the service using comments contained within
an embedded description element or grouping of methods and/or operations. Many
discussions of SOA specify the sole contract as dening the business interface. In
reality, there are two contracts of which management is less dened within the
industry.
In web services, the contract is described within a WSDL document and describes
an interface in two ways. First, it provides an abstract description of messages and
types. Second, it provides one or more concrete descriptions that bind the abstract
denition of the service to the selected messaging transport. WSDL can be extended
to support other transport bindings, marshalling mechanisms and even proprietary
binding protocols but how this is accomplished is not well documented.
WSDL documents should be segmented to separate the business contract from the
services technical binding.
We have also learned that while the vast majority of current SOA implementations
are point-to-point, we may need for our services to interoperate in a loosely coupled
manner where producer and consumer of services have no prior knowledge of each
other. WSDL is typically created using wizard type tools that tie the producer and
consumer together since the binding information and endpoint information may
be actually contained within the WSDL document. WSDL can be used to describe
service and operation names, message parts, data types and a return value but can
also be inappropriately used for more than it was originally intended to support.
In order to further understand the problem, let us pretend you have developed a
service that provides quoting for business partners and is secured using SSL. A simple
modication of the WSDL will allow you to change the transport from HTTP to
HTTPS in the address element of the location attribute. Over time, this service
may become used by a multitude of parties and becomes successful. After the service
reaches critical mass, the head of the corporate security department creates a new
policy where all electronic communications with third parties must be encrypted
using either 168-bit Triple DES or RC4 algorithms. The problem now becomes
harder than simply changing a single element in WSDL.
237
238
239
240
Compliance Requirements
Management Problem
Section 409 Real Time Issuer Disclosures
241
242
243
</port>
</service>
</definitions>
Code 1. WSDL to dene management interfaces
Within the WSDL document, we dened the shutdown operation as taking a
username and password to prevent arbitrary shutdown by unauthorized personnel as
well as a version service that can return meta-information about the service itself.
This approach allows application developers to include entry-level management
capabilities into their services by implementing the enterprise dened service
interfaces. Common interfaces used consistently throughout the enterprise makes
the task of adding management capabilities easily scoped and, more importantly,
repeatable. An enterprise can begin to create their own framework that can proactively
check the status of a service via simple polling constructs.
The proposed service interfaces are useful in creating a strategy whereby internal
management applications can be custom developed to understand the state of the
services network and while an improvement over simple logging, it will still introduce
problems of their own including who can call the services, in what context and how
often.
The real question that should be asked is whether application developers should
be implementing management functionality into services at construction time or
whether this concern should be externally managed. Enterprises are under constant
pressure to externalize systems, deliver quicker. This requires IT to leverage agile
methods for developing software and deferring many tasks to later phases that never
actually happen. Development teams would love visibility into the run-time behavior
of their service offerings but usually their requirements come second to business
demand.
Teams may be able to develop and deploy services quickly without management
capabilities. However, this often leads to disruptions of new development and missed
deadlines because the teams must triage and diagnose run-time service problems with
very little real-time information. The enterprise should consider approaches where
management is externalized from the services themselves.
The ideal abstraction would suggest having an enterprise framework that has
responsibility for management of services. A robust framework should provide
support for answering the following questions regarding management of services:
What services have to be managed?
What are the properties of the service?
244
2. Systems Management
Managing service-oriented architectures can be thought of as a new layer of
functionality on top of traditional management frameworks (i.e. Tivoli, BMC,
CA/Unicenter) that can understand and interact with the underlying infrastructure
and provide a mapping layer to how services behave on it. Traditional management
infrastructures provide visible and control of the underlying infrastructure but do not
245
provide management at the service request level which maps directly to a business
process.
A framework that understands services can provide additional value over traditional
management infrastructures in that it can not only alert but can make informed
decisions and provide alternatives to increase service reliability. Service-oriented
management frameworks can permit or deny service requests based on the identity
of the requestor, its content and/or its context. Frameworks in this space can reroute
requests to alternative service providers, provide load balancing across servers or
even data centers, transform messages and provide analytics surrounding run-time
performance and utilization.
Systems Management is comprised of the following components:
Logging,
Auditing,
Monitoring,
Alerting,
Provisioning.
Management of XML-based services is enabled via the principle of introspection.
While it is possible to have services that do not use XML, without the ability to
inject into the architecture third party components become difcult to manage and
usually require serialization, rebuilding and recompiling to change. Introspection of
XML can occur at run-time with default implementations and can be used to rapidly
instrument services without the service implementation changing.
2.1. Logging
Access to services from consuming applications should be logged at a minimum. These
logs can be used for various operational processes including services provisioning,
monitoring, performance evaluations, and business trend analysis.
Listed in Table 2 are some of the elements that we believe should be centrally logged
upon every service invocation.
Corporate security policies and software development standards should dictate which
elements of a log message are required vs. optional. From a software development
perspective, the framework component that handles capturing of logging records
246
Property
Service Name
Data type
String
Description
Name of the service
Service Protocol
Credential
String
String
Credential Token
String
Request Start
Timestamp
Request Finish
Timestamp
Log Timestamp
Timestamp
Timestamp
Request
sage
Mes-
Blob
Response Message
Severity
Blob
Timestamp
String
Warning
Critical
Informational
Diagnostic
Signature
Binary String
needs to be built with more system qualities than anything else within the enterprise
as it must reliably keep records of security-related and business transaction events.
Minimally, the logs will serve as a useful audit trail and can be used to conrm
compliance with government regulations and internal enterprise security policies,
detect breaches in security and helping diagnose production problems.
247
2.2. Auditing
In accounting, an audit trail provides a recorded log of sequences that help in
either validating or invalidating accounting entries. For services, the audit log may
track all changes to policies, starting and stopping security related services or other
administrative actions. Auditing can be considered an extension to logging but is
also used for different purposes. Logging often contains diagnostic information and
information regarding service requests while audit logs contain information about the
management framework itself in order to maintain higher order conceptual integrity.
Auditing also requires dependencies on external services in order to maintain integrity.
Some of the services required are given in Table 3.
Table 3. Auditing Requirements
Service
Description
Secure Storage
248
For more information on network time protocols and stratum, see Internet RFC
1769.
2.3. Monitoring
The ability to determine the health of the services network is vital to run-time
reliability. Operational snapshots that show the health of all services by averaging
values from the services connected through a single component (gateway or agent)
is mandatory. Usually, this information is best rendered in the form of a console
that displays the health of the selected component. Components can be optionally
compared to their specied service level agreement (SLA). An ideal approach is to
color key the display as shown in Table 4.
Table 4. Monitoring Color Key
Color
Green
Run-time Description
Service(s) is experiencing no errors.
SLA Description
Service(s) performing within SLA.
Yellow
Service(s) is experiencing errors, user experience not impacted. Service may have
failover or been re-routed.
Red
The ability to view run-time information on various components and services within
specied time periods allows one to quickly determine the overall health of the
services network and take action accordingly. Ideally, the management framework
should provide other metrics and views, see Table 5.
Table 5. Service Metrics
Metric
Downtime
Description
Information when the service is considered no longer able to process service
requests.
Execution Failure
Latency
Access Violations
If the service is accessed via a gateway, downtime can show the start and end times
of when the specied service started to fail and then started again to successfully
249
process service requests. For agents, this can indicate the amount of time where a
centralized facility that performs service-level pings has not completed. Execution
failures should be specied as a percentage for high-volume services and as a count
for low-volume services. For example, if the Yahoo Stock Quote service has a billion
requests per day, having a threshold count will create either too many false positives
or not show that anything is wrong. A better way in this situation may be to indicate
that monitoring should show yellow if the number of failed invocations goes over
1% within core business-hours and red if over 2%.
Latency is an expression of how much time it takes for a request to travel from one
designated point to another. A service will have zero latency if all data in the request
can be transmitted instantly between one point and another. Adding gateways and
agents will introduce application-level latency but this will also occur based on the
underlying network topology.
Latency of service invocations occurs due to several factors including:
Propagation,
Transmission,
Routing, and
Miscellaneous processing.
Propagation is the time it takes for a service request and response to travel between
producer and consumer respectively. Transmission of service requests occurs over a
multitude of physical network components (i.e. routers, ber, T1s, ATM, and so on)
that introduce their own delays. Service components such as gateways and agents may
need to examine the payload to determine next hop or provide additional processing
such as transformation and/or validating the service request came from an authorized
user.
High latency in routing and propagation tend to indicate performance bottlenecks
in the infrastructure while latency in routing and miscellaneous processing usually
occur due to sub-optimal service run-time resources, bad services design or service
components that require optimization. Latency can be improved by implementing
pre-fetching (anticipating the need for supplemental information) and introducing
multi-threading constructs that will allow processing to occur in parallel across
multiple threads of execution.
Access violations are useful in determining whether the services network is receiving
an increased amount of failed service invocations due to security considerations and
will help determine service-level denial-of-service, malformed requests or other forms
of attacks.
250
3. Alerting
Business alerts allow you to specify an action in response to a specic type of business
event. Alerts provide notication when a service is not meeting its service-level
agreement or not seeing the level of service requests expected. An alert can watch
for specic types of business events and initiate an action in response. Alerts can be
created on both message trafc patterns and other forms of system and aggregated
data.
Alerts can be created to notify individuals and distribution lists in a variety of manners
as well as invoke predetermined services. Some of the possible alerting facilities that
should be supported in a framework include:
Email notication (user and/or distribution list),
SNMP Traps, and
Service invocation.
Alerting can also be used for technical considerations. It may make sense for the
operations staff to classify all alerts into the following alert categories:
Response time,
Transaction size,
System fault, and
Trending.
251
of the payload could have the effect of slowing down overall service response times
especially in situations where XML is used. It may be useful to operations personnel
to be notied in situations where an individual service request sent a 10 MB XML
document where the typical document is 1 MB. Transaction size may also be used in
aggregation situations for operations personnel. For example, you may desire to be
notied if the average request size during any one-hour period has exceeded 50 MB.
3.4. Trending
Over time service request transaction times may deviate from expected values. Using
threshold scenarios in alerting situations can sometimes result in not getting alerted
when it is important to or on the other side receiving too many false positives. One
solution to this problem is the introduction of non-threshold-based analysis. One of
the more popular approaches is the use of Bayesian Belief Networks.
Bayes theorem is named after the Reverend Thomas Bayes who worked on the
problem of computing a distribution for the parameter of a binomial distribution.
In simple terms, he dened a mathematical formula based on probability inference,
which is a means of calculating, from the number of times an event has not occurred,
the probability that it will occur in the future.
Bayesian belief networks are used to develop knowledge-based management frameworks where usage patterns are characterized by inherent uncertainty. The ability to
apply reasoning with uncertainty sometimes overlaps with conventional knowledgebased capture techniques. For example, a stock quoting service may receive an average
of 1,000 requests per minute on days where the stock market is open, say Monday thru
Friday from 9am to 4pm eastern time excluding holidays. During this period, if the
number of requests goes over 5,000 an alert can be set using traditional approaches,
but what happens on Saturdays if the request volume is 750 requests per minute
when weekend trafc is lower? Now imagine the alert threshold being correlated to
news such as peace in the Middle East. You could not dene the alerting criteria
in advance but the system could learn trading volumes and take into considerations
252
trends such as increased trading volume near year end or even inverse patterns such
as the number of buy orders is dropping but the number of sell orders is increasing.
For more information on Thomas Bayes
http://www.bayesian.org/bayesian/bayes.html.
and
Bayesian
Beliefs,
see:
4. Provisioning
A management framework should be responsible for dening services behavior based
on its exposed business and technical functionality. Service consumers in enterprises
that implement per-usage chargeback mechanisms or for external service consumers
who are charged for usage should use a management framework that supports a
metering construct. Service usage can be billed based on usage/subscription patterns.
The logic for provisioning services should be built into a subscription engine that
exposes itself as a service. Service consumers can search for services against registries
where they have been given access and then apply for a subscription to the desired
services. Likewise, subscription policies can be dened as metadata in the registry in
which the management framework is responsible for enforcing.
253
requests within a specic time period and ultimately will create input to be used by a
billing service.
5. Leasing
A lease is a grant of guaranteed access over a time period. When the lease runs out,
the consumer must request a new one. Leases are negotiated between consumers
and the provider of the service as part of the service contract. Leasing helps prevent
stale caching information from queries to UDDI registries and other locator-based
services. The concept of a lease is necessary for SOA when services need to maintain
the state of information about the binding between consumers and producers. The
lease denes the amount of time for which the state may be maintained. Leasing
reduces coupling between service consumers and service producers by limiting the
amount of time consumers and providers may be bound. Without a leasing construct,
consumers could bind to a service forever and never rebind to its contract again.
When service producers need to change the implementation of a service, it can do
so when the leases held by consumers expire. This allows service implementations
to change without affecting the execution of the service consumers, because those
consumers must request a new contract and lease. When the new contract and lease
are obtained, they are not guaranteed to be identical to the previous ones.
254
Leases can be implemented so that they are either exclusive or non-exclusive. Exclusive
leases insure that no one else may access the resource during the period of the lease;
non-exclusive leases allow multiple service consumers to invoke the same service.
Leases can also be implemented using nite or innite constructs. A nite lease can
be used immediately or based on a future lease. Finite leases require service providers
to dene the exact period for which the service should be made available for discovery
in the registry. The lease period is restricted by the maximum allowable lease period
dened by the administrator.
Future leases allow a service provider to make the service discoverable once the lease
has been activated. Innite leases allow for the maximum allowable time for the lease
to change. This is useful in circumstances where a service provider wants to ask for
service consumers to periodically check back for changes in service contracts. Usually
innite leases should be constrained based on either a time period or ratio.
Leasing can be integrated into the provisioning system in which the elements are static
upon each request. This would require knowledge of how to handle leasing terms
at the service proxy and gateway. Alternatively, leasing can be implemented at the
gateway itself as a type of policy. This would allow consumers that do not understand
leasing constructs to function while maintaining loose coupling. Leasing can also be
tied into components that provide authentication, encryption and non-repudiation.
6. Billing
The billing service is responsible for creating and storing billing records. It has the
responsibility of creating billing entries into a separate billing provider system. For
internal usage, the billing service can create billing entries for chargeback purposes
into general ledger applications such as Peoplesoft, SAP or Oracle Financials. Table 6
shows the elements of a typical billing record.
Ideally, the billing service should expose an interface that can provide up to date
billing information for service consumers. The billing provider should physically
separate this interface from the billing services interface that is used to store billing
records as well as the interfaces actually used. It may be a good idea to consider
separating consumer access (query) from billing creation in order to deter fraudulent
access.
255
Description
The user ID of the service requestor.
Record Date
Duration
Reference
Service Name
Host
7. Pricing/Chargeback Models
Service level agreements establish the foundation for pricing and chargeback models.
Within most business models there will be services offered with no quality of service
guarantee and therefore may be freely available. Likewise, services that are used
in business transactions where quality of service is important, then pricing and
chargeback models become applicable.
In order to support effective pricing models, identifying the service consumer in a
non-repudiated manner may be required and may optionally support the usage of
digitally signed XML messages. The ability to collect revenue on services helps fund
future service enhancements and fund operations.
Several models for pricing & charge backs for services include:
Per User,
Per Transaction,
Percentage of Revenue,
Fixed Fee/Subscription,
Lease/License,
Business Partnership, and
Registration.
While decisions based on pricing models can be made at service construction time,
embedding this type of information within each service minimally will require
256
breaking of the provided service interfaces. If multiple models are employed, solving
for this at design-time becomes a fragile value proposition. Let us look at each of the
models in detail.
7.3. Lease/License
Leasing and licensing are common for large volume usage scenarios and are usually
based upon customized agreements. Service providers may charge based on the
number of service requests or the volume of requesting components (i.e. seats)
within the service requestors infrastructure. Leasing and licensing always occur via
out-of-band provisioning mechanisms.
257
7.5. Registration
Many web search engines now charge for registering Internet web sites in order to
for the site to be generally accessible. The same thinking can be applied to services
that will be externally accessed. One model may be to use a management framework
that intercepts publish requests to a UDDI registry and charges based on a pay to be
viewed concept as shown in Figure 5. This model assumes that if a service provider
wants to offer services, they will be willing to pay a registration fee.
The pricing/chargeback models discussed in this chapter are generally applicable to
any market segment and/or industry vertical.
8. Lifecycle Management
Traditional lifecycle processes focus on methodologies used to support developers
during the development process but fall short in considering what happens at
deployment time. A complete strategy should include all aspects of a services lifecycle
and follow the path of a service from its conception to its retirement. Lifecycles for
services really have two viewpoints, the development aspect which is developer driven
and the operational aspect which is driven by operations personnel.
258
259
Provisioning, and
Quality Assurance.
8.1. Routing
One of the tenets to Service-Oriented infrastructure (SOI) will be to eliminate single
points of failure within the enterprise. Usually this is accomplished by making sure
that a particular service has more than one instance either on a single machine and/or
on different machines. The services can also be spread across different geographic
locations. Ideally, location transparency should be incorporated into the architecture
so that clients are unaware to the physical location of each service and maintains a
single stable endpoint address.
A management framework may use load-balancing approach to make sure that
requests are evenly distributed across instances of a particular service. Different
service reception points may share a common queue provided by the framework
in which downstream service endpoints may be invoked in a round-robin fashion.
Invocation may also contain pluggable strategies to talk into account algorithms such
as afnity, weighted averaging, availability and quiescence.
To quiesce is to put a service or other computer resource into a temporarily inactive
state whereby in-progress requests are serviced but new requests are denied.
Support for afnity is important in two different situations. The rst usage of afnity
is to support service requests that are stateful by nature. Stateful services are highly
discouraged but the management framework should support it anyway. The second
usage for afnity is to increase performance of services where it may internally cache
access to downstream data sources such as relational databases, le systems or other
resources. An advanced form of afnity is known as Class afnity where groups of
services say from a particular user population (i.e. VIP customers, partners) may be
routed to a different set of services. Ideally, afnity will be dened on a per service
basis in a weak manner (for stateless services) where the vast majority of requests
for afnity are desired but not guaranteed or strongly where it is. Strong afnity
will return an error condition back to the consumer in case the target server cannot
handle the request.
Afnity is an approach to load balancing that directs multiple incoming requests
from the same consumer are always to the same producer. Service afnity disables
workload management after initial service invocation by forcing requests to always
return to the initial connection endpoint.
260
A GUID is a 128-bit integer that is unique across both space and time.
If the interface uses a document-style approach where an arbitrary number of
parameters can be passed using either an XML tagged approach as a string and/or
strongly typed object such as a property bag, then versioning can be implemented
261
inside of the service itself. Let us look at a code snippet in Java that demonstrates this
concept:
public class OrderDTO extends VectorDTO {
private static final long serialVersionUID = 1;
protected Vector bag;
}
Code 2. Data transfer object
Let us now extend to OrderDTO to contain the currency type used when placing an
order:
public class OrderDTO extends VectorDTO {
private static final long serialVersionUID = 2;
protected Vector bag;
public Currency typeOfMoney;
}
Code 3. Extending a DTO
The DTO can be passed to a method that may have the following signature:
public Boolean Process(OrderDTO order)
Within the process method, you can determine if the DTO is the version you expect by
using a method that exposes the value of serialVersionUID and can optionally upgrade
the interface as appropriate without forcing all clients to recompile. Development
time changes can be accomplished with you have administrative control over both
the client and the server but otherwise is limiting. Versioning as a problem space is
not limited to strictly producer side concerns but can also occur if you are a consumer
that needs to talk to an upgraded service but cannot modify your own code.
Versioning of services has similarities with traditional object-based approaches but also
varies in subtle ways. A management framework attempts to externalize versioning
concerns out of code and keeping this information centralized. By having versioning
handled by a framework, it affords several opportunities including:
Ability to perform version upgrades of services without reducing service
availability.
Hot deployment and maintenance of new parallel version of services.
Creation and support of multiple mirrors support each version of the service.
The ability to commission and decommission servers in both provider and
consumer modes.
262
Versioning will also afford the enterprise the ability to combine versioning constructs
with provisioning constructs. For example, a free version of the service could be
offered that supports an older version of a service while paid customers can access
newer versions of the service. The ability to establish version-based access control
is especially important for high-volume consumer driven architectures. In this same
situations, the ability to externalize versioning information within the application will
allow for centralized notication to consumers when newer versions of the service are
available and/or when currently supported services will be deprecated.
Service-oriented architectures that leverage XML as the transport make versioning
easier since a framework can provide introspection capabilities on the payload and
upgrade/downgrade as appropriate through transformation constructs. If your SOA
uses binary protocols such as classes, an intermediary may be capable (although not
usually the case) of converting objects from one type to another. It may be useful to
provide routing to the service that has the highest numerical version unless the client
species otherwise.
Upgrading of interfaces can be accomplished by software that supports either/both the
Proxy Pattern or Intercepting Filter Pattern. These patterns can also for the creation
of framework components that can intercept the message upon service invocation by
changing the message in-ight while passing the request to and from the service.
For more information on patterns, please see Gamma et al. (1994). The Intercepting
Filter pattern is covered in detail in Alur et al. (2003).
Use of document-style services is order of magnitudes easier to implement versioning
constructs over document style approaches. Document style allows for the usage of
XML and allows for situations in which versioning is not so direct. Since XML
processing allows for addition of elements, older clients will simply ignore them.
Document-style enables versioning of interfaces that use queuing approaches, since
elements may need to be accessed externally to the document itself such as priority.
8.3. Transformation
Transformations of XML payloads by management frameworks allow services to
bridge the information models and business processes within composable services
architecture. If you ask yourself, how do I get the message into the right format for
its next destination, the requirement for transformation becomes clearer.
The management framework should provide the ability to handle complex transformation of messages and the ability to map between message formats. In services that
263
are purchased off the shelf, the vocabulary used could be wide-ranging. For example,
elds named given name and surname may need to be converted to elds named rst
name and last name in order to be processed by downstream services.
Messages may also be required to be broken into a number of new messages each
with their own routing. Let us look at one example:
<?xml version="1.0"?>
<!DOCTYPE ORDER SYSTEM "order.dtd">
<?xml-stylesheet type="text/css" href="xmlorderpart.css"?>
<Orders>
<Customer>
<CustNumber>BICHE1</CustNumber>
<CompanyName>Budhoorams Auto Body</CompanyName>
<ContactName>Khaimraj Kelon</ContactName>
<ContactTitle>CEO</ContactTitle>
<CountryCode>TT</CountryCode>
<Phone>868-666-0123</Phone>
</Customer>
...
<Customer>
<CustNumber>SHOOP1</CustNumber>
<CompanyName>Little Red Zuper Car</CompanyName>
<ContactName>James Franklin</ContactName>
<ContactTitle>CEO</ContactTitle>
<CountryCode>US</CountryCode>
<Phone>860-242-8050</Phone>
</Customer>
</Orders>
Code 4. Composite order message
In the above code, we have a composite order that contains two different customers
in different countries (Trinidad and the United States). In this situation, we may
need to route the request to two different services, which will require breaking up the
document into two distinct messages as follows:
<?xml version="1.0"?>
<!DOCTYPE ORDER SYSTEM "order.dtd">
<?xml-stylesheet type="text/css" href="xmlorderpart.css"?>
<Orders>
<Customer>
<CustNumber>BICHE1</CustNumber>
264
<?xml version="1.0"?>
<!DOCTYPE ORDER SYSTEM "order.dtd">
<?xml-stylesheet type="text/css" href="xmlorderpart.css"?>
<Orders>
<Customer>
<CustNumber>SHOOP1</CustNumber>
<CompanyName>Little Red Zuper Car</CompanyName>
<ContactName>James Franklin</ContactName>
<ContactTitle>CEO</ContactTitle>
<CountryCode>US</CountryCode>
<Phone>860-242-8050</Phone>
</Customer>
</Orders>
Code 6. Order message United States
The ability to convert from one message format to another is a fundamental principle
in enterprise integration. A framework can accept incoming XML data and perform
specialized XML transformations using XSLT and XPATH. Usually the least nonperforming aspect of any XML-based SOA is related to transformation. The ability
to rst externalize this from services to a framework will allow the enterprise to take
advantage of newer parsers without disturbing existing service code bases.
XML transformations can also be ofoaded to specialized XML appliances that
implement XML transformation within hardware. Hardware-based solutions have a
performance gain of factors of 20 to 1 or even greater. XML encryption and digital
signatures can also be ofoaded to specialized cards in order to provide additional
performance benets. Ideally, the framework will allow for transformation engines to
be congured using approaches such as Javas API for XML Processing (JAXP).
Datapower, Sarvega, Reactivity and Tarari are the leading vendors in this space.
265
8.4. Provisioning
Services are expressed in business terms and so should service levels. Traditional
service level agreements were based on technical constructs and had no tie to business
benet. A framework should provide a comprehensive way of translating a service
level agreement into the allocation of resourced required by consumers of the service
and may be comprised of required security proles, policies surrounding prioritization
of trafc and the number of requested that be executed during a given time period.
Service level agreements are abstract concepts that provide a mechanism for partners
to understand each others capabilities, to negotiate service parameters and assist
with providing a management goal. Service level agreements ideally provide a level
of separation between partners in managing concerns between them. A well-dened
service level agreement is given in Table 7.
Table 7. Components of a Service Level Agreement
Constraint Type Elements
Date
Start Date
End Date
Next Evaluation Date
(optional)
Function
Name
Day Time
Days of week
Hours
Process
Name (optional)
Construct
Description
Measured Item
Name
Location
Description
Species the date the service level agreement starts
and ends (i.e. 16 February 1977 to 10 September
2001) and the date in which the agreement can
be re-evaluated.
266
transactions as measured from the gateway should be less than ve seconds. In this
example, we have specied constraints on date, day/time, a group of processes and
where the agreement will be measured.
267
Provisioning engines attempt to unify and centralize business rules around provisioning requirements. This may be implemented using a gateway approach in a distributed
manner that may synchronously or asynchronously update the provisioning system of
record. The gateway can be considered a provisioning service point or can optionally
manage a separate provisioning service.
268
Since services can reside within the enterprise or external, it becomes important that
testing instead concentrate on services within administrative control due to issues of
causing unnecessary load from the external partys perspective.
SOA starts with the notion of a contract that is published by the service provider in
which consumers will leverage. Quality assurance in an SOA needs to concentrate
on making sure that the contract does not change between releases, that interfaces
over the lifetime of a service remain immutable and that developers have employed
appropriate defensive coding techniques within the application to handle invalid data
being passed to the service. Of even greater importance is guring if services adhere
to applicable industry standard schemas (where appropriate) and following enterprise
and industry vertical semantic constructs.
Management frameworks assist in quality assurance initiatives in several important
ways. First, they provide the ability to capture logging and diagnostic information
that will assist in quality assurance. The ability to quantify the amount of successful
requests vs. failed requests is a simplistic feature of a framework. Second, the
ability to have a strategy that can intercept specied requests to services external
to the enterprise or in situations where the service has usage costs and/or updates
transactional production systems becomes important. For example, if you are testing
your internal general ledger and it leverages a funds transfer service to your local
bank, it becomes viable to perform regression tests on all internal services with the
ability to simply return a predened message on behalf of the funds transfer service
without actually invoking it.
269
Business processes minimally include constructs that support the following notions:
Message Prioritization.
Business Activity Monitoring.
Let us discuss what these areas mean and how we can incorporate them into a services
management strategy.
270
arise. Business activity monitoring can provide both real-time and historical services
activity monitoring and visualization and trafc information.
There are three high-level goals of business activity monitoring:
1. Ability to create a dashboard for executives who need aggregated information on
business activity at anytime, anywhere.
2. Monitor of business processes and activities in real-time to anticipate and manage
problems before they impact the bottom line.
3. Streamline operations with real-time access to the information line managers
need when they need it.
Business activity monitoring leverages the management frameworks ability to
introspect service request trafc and uses not only for technical considerations
but business focused events. It also incorporates disciplines found elsewhere within
the enterprise such as business intelligence built into data warehouses.
271
ability to drill-down and see if it has a common root cause, the requirement to see
information in real-time becomes crucial. Using a service management approach not
only provides you with information but also context.
9. Management Architecture
A well-dened management strategy for services will lead to the conclusion that
execution can be distributed but management should be centralized. Management
can be accomplished using two basic methods, gateways and agents. Gateways are
a specialized proxy that intercept requests, enforce policies and forward requests
to downstream services. Agents are deployed as intercepting lters into services
containers such as Axis, Systinets WASP or in-house frameworks and enforce policies
in the address space of the service.
Let us look at the architecture of the following components:
Gateways,
Agents, and
Centralized Policies.
9.1. Gateways
In many enterprises, the infrastructure includes use of a proxy server that acts as
an intermediary between an internal computer resource and the Internet so that
the enterprise can ensure security, administrative control and caching to reduce
bandwidth usage. Proxy servers serve to separate the enterprise network from the
outside network.
Traditional proxy servers operate on the packet level. A network router functions by
examining TCP/IP packet headers and performing network routing decisions based
on rules that specify observed patterns in the packet ow. Firewalls block packet
ow by disallowing trafc that does not comply with specied policies and allowable
parameters.
There is also what is known as a reverse proxy server where users external to the
enterprise may make a request for an Internet service such as web page that resides on
an internal web server. If the request passes ltering requirements, the proxy server
272
will return the page to the user. If the proxy server implements caching, it will serve
the request out of is local store. If the request cannot be served out of its local store
will uses one of its own IP addresses to request the page from the server and forward
the response to the user on the Internet. To the Internet user, the proxy server is
invisible; all requests and responses appear to be answered directly by the proxy.
Use of TCP/IP ports and HTTP header information is insufcient for making
routing decisions based on XML-based content. Proxies that understand XML are
capable of examining trafc at the content level can serve as a mediator for both client
and server operations and perform operations itself or simply allow XML trafc to
ow through. When an intermediary can handle both situations it is referred to as a
gateway.
In services architecture, a gateway can be thought of as a specialized proxy that
understands request for services. A gateway is also analogous to a router in that it
knows where to direct a given packet of data that arrives at the gateway and a switch
that furnishes the actual path in and out of the gateway for a given packet.
Gateways when used with services will act as an intermediary for service request
and responses and enforce policies for each connected service. Gateways will require
that each service that will pass through it be registered and will create a new URL
for intercepting the request that can be published to other parties. The URL of the
service on the gateway will be the one published in a UDDI registry (Figure 8).
9.2. Agents
Agents run in context of the services address space and usually are implemented as
an intercepting lter. As agents are congured to run in the services container, they
can intercept all incoming requests and do not require generation of a proxy URL in
the same manner that gateways require. This approach also allows for services to be
globally managed vs having per-service registration requirements.
273
274
in the state of Connecticut. Rules can be classied broadly in two categories (see
Table 8).
Table 8. Operational Rules
Rule Type
Description
General
Inspect all service invocations and take action each time rule
conditions are satised.
Aggregation
General rules when tied to processing instructions such as alerting allows contextual
information about specic events to be preserved but also can cause a ood in
scenarios where service failures occur in high throughput systems. General rules
should be applied in controlled situations as processing of the rules themselves could
have an adverse impact on the entire service network.
Aggregated rules provide a benet in that they are applied to summarized information
and therefore will generate less actions. This can be useful in scenarios where highthroughput services experience a failure but also have its own limitations in that
specic information about particular events may not be captured (for rule criteria,
see Table 9).
Table 9. Rule Criteria
Element
Name
Type
Description
Name of the rule.
Specify whether this rule is general or an aggregate.
Description
Action
Condition
Conditional rules may contain one or more elds within an XML message and
correspond to a specied value. Rule conditions are usually best expressed when
composed of two operands and a comparator. Optional support for XQuery
expressions should be supported in management frameworks.
For more information on XQuery, see McGovern et al. (2003).
275
9.5. Components
Policies are ultimately executed on either/both gateways and agents. Many of the
management concerns such as logging, metering and monitoring can be implemented
as both gateways and agents. However some management concerns may be limited
to one or the other. Let us look at concerns that have limited implementation in
Table 10.
Table 10. Management Attributes Matrix
Attribute
Routing
Category
Systems Management
Limitation
Gateway
Non-Repudiation
Message Prioritization
Security
Business Process
Agent
Gateway
Routing determines which service endpoint a particular request gets routed to. Since
agents run in context of the target service, the ability to change the target is already
too late. If you implement your own SOA framework and do not rely on SOAP or
other message formats, then it is possible to develop a custom message similar to the
HTTP protocol and its support for redirect headers (http status 302).
Non-repudiation is the ability to ensure that a party to a conversation (request/response) cannot deny the authenticity of their signature on a document or
the sending of a message that they originated. Since gateways serve as intermediaries
to service requests and have the ability to modify requests, they cannot be used to
provide end-to-end non-repudiation. The gateway can participate in non-repudiation
but ultimately the end service requiring non-repudiation related policies are required
to run as an agent in the address space of the service.
How to implement non-repudiation is covered in detail in Chapter 4.
Message prioritization can be implemented as either an advanced form of routing
and/or a buffering strategy. Buffering of trafc within the service in order to gain
prioritization would require adding cross-request scheduling internal to each service.
Although it is technically possible to perform this task by making worker threads go
to sleep for services that are multi-threaded, this would make service development
more complex than required and therefore is discouraged.
276
Cluster
Interval-Based
Member
On-Demand
Description
Receives notication when synchronized policy data changes. The
changed content is updated automatically and immediately on all
members in the synchronization loop.
This serves to synchronize all member policy services under the
same administrative federation.
Synchronization occurs based on predened interval or schedule.
This serves to synchronize a single member policy service with a
master policy service.
This form of synchronization only occurs when an administrator
specically requests it.
277
278
Figure 11. Policy Pipeline Using Pipes and Filter as Architectural Style
Filters are implemented with a generic interface that allows for reuse. The pipeline
will have several lters registered to it that will when receiving messages on the
inbound pipe, the lter will process the message and return the results back to the
outbound pipeline in a manner that allows them to be chained. Using this pattern for
components will allow you to add new lters, remove ones that are no longer needed
279
or even rearrange them into new sequences without having to touch the lter code
itself.
For more information on pipes and lters, see Buschmann et al. (1996).
Generic components can be developed and reused on both agents and gateways
when using the pipes and lters pattern. Listed in Table 12 are several recommended
components.
Table 12. Policy Pipeline Components
Name
Category
Authentication Security
Description
Validate that the service request is coming from an authorized
user.
Check to see has been granted rights to the specied service.
Authorization
Security
Certicate
Security
SAML
Log
Security
Logging
Transform
Validate
Product
CoreSV
Web Site
http://www.oblix.com/conuent/index.html
Blue Titan
Actional
Network Director
Looking Glass
http://www.bluetitan.com
http://www.actional.com
Digital Evolution
Infravio
Management Server
Ensemble
http://www.digev.com
http://www.infravio.com
280
12. Summary
Software as a service is important to enterprises not only to build internal systems but
also to extend the enterprise to partners, suppliers and consumers. As services allow
applications to become modular, and access to domains outside of administrative
control, traditional issues that require operational attention become even more
challenging. Services in this model must have a comprehensive management strategy
required for protable operation of the business. Management of services includes the
entire service value chain and collecting information about the health and availability
of services. All of these requirements can be accomplished in a vendor-neutral manner.
7
TRANSACTIONS
Life is an error-making and error-correcting process.
Jonas Salk, developer of the polio vaccine
As the concept of SOA has evolved as a means to integrate processes and applications at
an inter-enterprise level, traditional transaction semantics and protocols have proven
to be inappropriate. SOA-based transactions differ from traditional transactions in
that they execute over long periods, they require commitments to the transaction to
be negotiated at run-time, and isolation levels have to be relaxed. These kinds of
business-to-business transactions often require an extended transaction model that
builds on existing SOA standards and denes an interoperable transaction protocol
and message ows that help negotiate transactions guarantees at the inter-enterprise
level.
In this chapter we will look at the area of transactions as they apply to SOA and Web
Services in particular. We will show how although this is still an active area of work, it
is an extremely important one for the overall SOA environment; without transaction
capabilities, it is impossible to build complex composite applications that people can
trust to ensure consistent state changes, even in the presence of failures. However,
before examining the kinds of SOA transaction protocols that have been developed,
we need to rst examine what are often referred to as traditional ACID transaction
systems.
282
Chapter 7: Transactions
283
Let us consider a very simple example: imagine that Mr. Doe wants to reserve a block
of seats for his family (1A, 1B and 1C as shown in the gure). Now, the service only
allows a single seat to be reserved through the reserveSeat operation, so this will
require Mr. Doe to call it three times, once for each seat.
Unfortunately the reservation process may be affected by failures of software or
hardware that could affect the overall consistency of the system in a number of ways.
For example, if a failure occurs after reserving 1A, then obviously none of the other
seats will have been reserved. Mr. Doe can try to complete the reservation when
(assuming) the cinema service eventually recovers, but by this time someone else may
have reserved the seats.
What Mr. Doe really wants is the ability to reserve multiple seats as an atomic
(indivisible) block. This means that despite failures and concurrent access, either all
of the seats Mr. Doe requires will be reserved for him, or none will. At rst glance
this may seem like a fairly straightforward thing to achieve, but it actually requires a
lot of effort to ensure that these requirements can be guaranteed. Fortunately atomic
transactions possess the following (ACID) properties that make them suitable for this
kind of scenario:
Atomicity: The transaction completes successfully (commits) or if it fails (aborts)
all of its effects are undone (rolled back).
Consistency: Transactions produce consistent results and preserve application
specic invariants.
Isolation: Intermediate states produced while a transaction is executing are not
visible to others. Furthermore, transactions appear to execute serially, even if
they are actually executed concurrently. Typically this is accomplished through
the use of concurrency control techniques (e.g., locks) associated with shared
resources.
Durability: The effects of a committed transaction are never lost (except by a
catastrophic failure).
A transaction can be terminated in two ways: committed or aborted (rolled back).
When a transaction is committed, all changes made within it are made durable
(forced on to stable storage, e.g., disk). When a transaction is aborted, all of the
changes are undone. Atomic transactions can also be nested, and in which case the
effects of a nested action are provisional upon the commit/abort of the outermost
(top-level) atomic transaction.
Associated with every transaction is a coordinator, which is responsible for governing
the outcome of the transaction. The coordinator may be implemented as a separate
284
service or may be co-located with the user for improved performance. It communicates
with enlisted participants to inform them of the desired termination requirements,
i.e., whether they should accept (commit) or reject (roll back) the work done within the
scope of the given transaction. For example, whether to purchase the (provisionally
reserved) ight tickets for the user or to release them. A transaction manager factory is
typically responsible for managing coordinators for many transactions. The initiator
of the transaction (e.g., the client) communicates with a transaction manager and
asks it to start a new transaction and associate a coordinator with the transaction.
Traditional transaction systems use a two-phase protocol to achieve atomicity between
participants, as illustrated in Figure 2: during the rst (preparation) phase, an
individual participant must make durable any state changes that occurred during
the scope of the transaction, such that these changes can either be rolled back
or committed later once the transaction outcome has been determined. Assuming
no failures occurred during the rst phase, in the second (commitment) phase
participants may overwrite the original state with the state made durable during
the rst phase.
Chapter 7: Transactions
285
286
Unlike the two-phase commit protocol, the synchronization protocol does not have
the same failure requirements. For example, Synchronization participants do not need
to make sure they can recover in the event of failures; this is because any failure before
the two-phase commit protocol completes means the transaction will roll back, and
failures after it has completed cannot affect the data the Synchronization participants
were managing.
Chapter 7: Transactions
287
288
the transaction service and will thus lead to a loss of integrity in the system. Having
to perform resolution of heuristics is something you should try to avoid, either
by working with services/participants that do not cause heuristics, or by using a
transaction service that provides assistance in the resolution process.
Now that we have described the advantages that ACID transactions offer, you may be
asking yourself why they are not sufcient for use in an SOA environment. An ACID
transaction provides failure atomicity, isolation from concurrent users etc. so would
appear to be an ideal tool for use when building complex distributed applications.
Unfortunately as we will see in the next section, this is often not the case.
Chapter 7: Transactions
289
(t1), reserving a table at a restaurant (t2), reserving a seat at the theatre (t3), and then
booking a room at a hotel (t4), and so on. If all of these operations were performed
as a single transaction then resources acquired during t1 would not be released until
the transaction has terminated. If subsequent activities t2, t3 etc. do not require those
resources, then they will be needlessly unavailable to other clients.
However, if failures and concurrent access occur during the lifetime of these
individual transactional activities then the behavior of the entire logical longrunning transaction may not possess ACID properties. Therefore, some form of
compensation may be required to attempt to return the state of the system to
consistency. For example, let us assume that t4 aborts. Further assume that the
application can continue to make forward progress, but in order to do so must now
undo some state changes made prior to the start of t4 (by t1, t2 or t3). Therefore, new
activities are started; tc1 which is a compensation activity that will attempt to undo
state changes performed, by say t2, and t3 which will continue the application once
tc1 has completed. t5 and t6 are new activities that continue after compensation,
e.g., since it was not possible to reserve the theatre, restaurant and hotel, it is decided
to book tickets at the cinema.
290
Management Group, see OTS) did not manage to get past the vendor lock-in
barrier, and attempts at using transactions across enterprise boundaries failed because
in such systems transactions are assumed to exhibit ACID properties.
Web services present a different kind of problem: they are specically about fostering
systems interoperability. This presents some interesting problems from a transaction
management point of view. What makes Web services so interesting is the fact that
the architecture is deliberately not prescriptive about what happens behind service
endpoints Web services are ultimately only concerned with the transfer of structured
data between parties, plus any meta-level information to safeguard such transfers (e.g.,
by encrypting or digitally signing messages) yet it is behind service endpoints that
we nd traditional transaction processing architectures supporting business activities.
Thus we are presented with a paradox. The Web services platform provides a
service-oriented, loosely coupled, and potentially asynchronous means of propagating
information between parties, whilst in the background we have traditional transaction
processing infrastructures whose behavior is neither or mutually interoperable.
Furthermore, the fact that transactions in these systems are assumed to exhibit ACID
properties potentially leads to problems when exposing resources to third parties, since
it presents opportunities to those parties to tie up resources and prevent transactions
from making progress. Thus if transactions were to be supported in the Web services
architecture then it is clear that some re-addressing of the problem is required.
As you might imagine from what we have said earlier, since transactions are an
important aspect of distributed systems in general and almost an imperative to ensure
SOAs can scale to enterprise applications, there has been quite a lot of activity in the
area of developing SOA transaction models. In the next section we will look at the
current leading specications for Web services transactions; it is important to realize
that these specications are applicable to other SOA environments.
Chapter 7: Transactions
291
The rst attempt at dening a standard for Web Services transactions was the OASIS
Business Transaction Protocol (BTP) in 2001; this was then followed by the Web
Services Transactions specication (WS-Tx, now renamed WS-AtomicTransaction
(see WSAA) and WS-BusinessActivity (see WSBA)) from IBM, Microsoft and BEA
in August 2002, and more recently by the Web Services Transaction Management
specication (WS-Transaction Management) from Arjuna Technologies, Fujitsu,
IONA Technologies, Oracle and Sun in August 2003 (part of the OASIS Web
Services Composite Application Framework, see WSCAF).
Although originally having the backing of BEA, Hewlett-Packard and Oracle, the
OASIS BTP has been overtaken by the other two specications. There are a number
of technical reasons often cited for this, including the complexity of the protocol,
the fact that it was not designed solely for Web Services (often coupled with
its complexity) and lack of immediate interoperability with existing transaction
processing infrastructures. However, it is likely to be the lack of support for this
protocol from major vendors that will ultimately consign it to a niche area of history
(as seems to be the case in Web services, the political factors almost always outweigh
any technical benets). As such, in the rest of this chapter we will concentrate
solely on WS-AtomicTransaction and WS-BusinessActivity (we will refer to them
collectively as WS-Tx) and WS-TransactionManagement (WS-TXM).
In the following sections we will examine these specications. However, because of
space constraints we cannot cover them all in detail. Rather, we will look at the
commonality that exists between them and discuss the impact that the models they
provide will have on developing SOA applications.
292
Chapter 7: Transactions
293
sections we will look at the general architecture that both frameworks share and
indicate where differences arise.
Before we do so though, it is worth mentioning the interaction patterns that both sets
of specications assume. In order to support both synchronous request/response and
message interactions, all interactions are described in terms of correlated messages,
which an implementation may abstract at a higher level into request/response pairs.
As such, all communicated messages are required to contain response endpoint
addresses solely for the purposes of each interaction, and a correlation identier such
that incoming and outgoing invocations can be associated.
This has the immediate benet of allowing loose coupling of application entities:
the sender of a given message that requires a response need not be the same as
the ultimate receiver of that response. This allows for great exibility in choosing
service deployments, particularly in environments that may be error prone or require
dynamic changes to roles and responsibilities. However, one consequence of these
interactions is that faults and errors which may occur when a service is invoked are
communicated back to interested parties via messages which are themselves part of
the standard protocol and does not use the fault mechanisms of the underlying
SOAP-based transport.
294
Chapter 7: Transactions
295
For simplicity we will only show the WS-C interfaces for its Activation Service in
Listing 1. The service has a one-way operation that expects to receive a CreateCoordinationContext message and the service that sent the CreateCoordinationContext
message expects to be called back with a CreateCoordinationContextResponse
message, or informed of a problem via an Error message.
<!-- Activation Service portType Declaration -->
<wsdl:portType name="ActivationCoordinatorPortType">
<wsdl:operation name="CreateCoordinationContext">
<wsdl:input
message="wscoor:CreateCoordinationContext"/>
</wsdl:operation>
</wsdl:portType>
<!-- Activation Requester portType Declaration -->
<wsdl:portType name="ActivationRequesterPortType">
<wsdl:operation
name="CreateCoordinationContextResponse">
<wsdl:input
message="wscoor:CreateCoordinationContextResponse"/>
</wsdl:operation>
<wsdl:operation name="Error">
<wsdl:input message="wscoor:Error"/>
</wsdl:operation>
Listing 1. The WS-Coordination Activation Service interface
296
Chapter 7: Transactions
297
portion of the business logic of your application, e.g., an on-line airline reservation
service.
However, what about the participant service? Normally it is the case that only some
aspect if the work that the service does will require coordination, and in fact this may
be an aspect that the original service provider did not know about at the time the
service was designed and implemented.
For example, let us take the case of a transactional Web service. In this case, the
transactional capabilities of the service are often not exposed to users of that service,
as they are typically considered to be non-functional aspects of its work. It is
frequently the case that many transactional services or components began life as nontransactional, and were upgraded as requirements for fault-tolerance and reliability
changed. In the case of the on-line airline reservation service, for instance, the fact
that individual seats are reserved and unreserved atomically is not noticed by its users,
since that is an implementation detail (e.g., provided by the database technology that
the service implementer has used to store information about individual aircraft).
Because of this, it has been the case over many decades that transaction systems
usually separate out the work that is required to make a service transactional from
the usual business logic. This separation has been taken and generalized by the
coordination frameworks: the coordination participant is the service that controls
this work and is driven by a specic coordinator. This has obvious benets in that
a non-transactional service can be made transactional without having to change its
interface the interface is managed separately by the participant. If the application
Web service actually needs to participate in multiple different types of coordination
(e.g., security and transactions), then it would typically possess a participant for each
type.
Let us return to the coordination framework and see how this maps. Once a
coordinator has been instantiated and a corresponding context created, there is going
to be a need to be able to register participants with the coordinator. Rather than
assume that the service that created the context is also the one that handles participant
registration (that is an implementation choice, after all), both frameworks separate
this out into what WS-C calls a Registration Service and WS-CoordinationFramework
calls a Coordinator Service. Regardless of its name, this service allows participants to
register to receive protocol messages associated with a particular coordinator.
Like the activation service, the registration service assumes asynchronous communication and so species WSDL for both the service that registers and the service that
receives the result of registering. In Listing 3 we will only show the partial interfaces
for the ServiceCoordinator and the ServiceRespondant.
298
<wsdl:binding name="ServiceCoordinatorPortTypeSOAPBinding"
type="tns:ServiceCoordinatorPortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document"/>
<wsdl:operation name="addParticipant">
<soap:operation
soapAction="http://www.webservicestransactions.org
/wsdl/wscf/2003/03/addParticipant" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
<soap:header part="content" use="literal"
message="tns:ContextMessage"/>
</wsdl:input>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="ServiceRespondantPortTypeSOAPBinding"
type="tns:ServiceRespondantPortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document"/>
<wsdl:operation name="participantAdded">
<soap:operation
soapAction="http://www.webservicestransactions.org
/wsdl/wscf/2003/03/participantAdded"
style="document"/>
<wsdl:input>
<soap:body use="literal"/>
<soap:header part="content" use="literal"
message="tns:ContextMessage"/>
</wsdl:input>
</wsdl:operation>
</wsdl:binding>
Chapter 7: Transactions
299
(and is obviously only possible if the coordinator implementation supports it), but
there are actually cases where this could help. Let us return to the case of a transactional
service, where its participant knows that even though the transaction may last for
many more hours, it is response to being told to prepare will never change; as a
result, the participant can tell the coordinator what that response is immediately (and
perhaps even be garbage collected). This can help to improve performance and in
some cases tolerance to failures.
300
Chapter 7: Transactions
301
302
</CreateCoordinationContext>
<!-- Atomic transaction context -->
<wscoor:CoordinationContext
xmlns:wscoor="http://schemas.xmlsoap.org/ws/2002/08/wscoor"
xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility">
<wsu:Identifier>
http://example.org/tx-id/aabb-1122-ddee-3344-ff00
</wsu:Identifier>
<wsu:Expires>2003-06-30T00:00:00-08:00</wsu:Expires>
<wscoor:CoordinationType>
http://schemas.xmlsoap.org/ws/2003/09/wsat
</wscoor:CoordinationType>
<wscoor:RegistrationService>
<wsu:Address>
http://example.org/ws-transaction/registration
</wsu:Address>
</wscoor:RegistrationService>
</wscoor:CoordinationContext>
Listing 4. Atomic transaction context
After obtaining a transaction context from the coordinator, the client application
then proceeds to interact with Web services to accomplish its business-level work.
Neither specication denes how a client can determine whether or not a service
is transactional and hence can deal with the associated context. Currently there is
no equivalent of the J2EE deployment descriptor for services, or the OMGs Object
Transaction Service for dening that a service is transactional and as such requires a
valid context to be carried on all client-service interactions. No doubt this oversight
will be removed when the likes of WS-Policy statements are extended to transactional
semantics. Until that happens, however, each invocation on a business service requires
the client to propagate the context, such that the each invocation is implicitly scoped
by the transaction.
Chapter 7: Transactions
303
<wsdl:portType name="twoPCParticipantPortType">
<wsdl:operation name="prepare">
<wsdl:input message="tns:PrepareMessage"/>
</wsdl:operation>
<wsdl:operation name="onePhaseCommit">
<wsdl:input message="tns:OnePhaseCommitMessage"/>
</wsdl:operation>
<wsdl:operation name="rollback">
<wsdl:input message="tns:RollbackMessage"/>
</wsdl:operation>
<wsdl:operation name="commit">
<wsdl:input message="tns:CommitMessage"/>
</wsdl:operation>
<wsdl:operation name="forgetHeuristic">
<wsdl:input message="tns:ForgetHeuristicMessage"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:portType name="CoordinatorParticipantPortType">
<wsdl:operation name="committed">
<wsdl:input message="tns:CommittedMessage"/>
</wsdl:operation>
<wsdl:operation name="rolledBack">
<wsdl:input message="tns:RolledBackMessage"/>
</wsdl:operation>
<wsdl:operation name="vote">
<wsdl:input message="tns:VoteMessage"/>
</wsdl:operation>
<wsdl:operation name="heuristicForgotten">
<wsdl:input message="tns:HeuristicForgottenMessage"/>
</wsdl:operation>
<wsdl:operation name="heuristicFault">
<wsdl:input message="tns:HeuristicFaultMessage"/>
</wsdl:operation>
</wsdl:portType>
Listing 5. The two-phase commit participant and coordinator WSDL
Transaction termination normally uses the two-phase commit protocol. If a transaction involves only a single participant, both models support a one-phase commit
optimization similar to that in traditional transaction systems. Figure 6 shows the
state transitions of an atomic transaction.
304
Chapter 7: Transactions
305
306
WS-BusinessActivity model is less well dened. Such scopes can be nested to arbitrary
levels, forming parent and child relationships. A parent scope has the ability to select
which child tasks are to be included in the overall outcome protocol for a specic
business activity, and so clearly non-atomic outcomes are possible. A business activity
denes a consensus group that allows the relaxation of atomicity based on business
level decisions. If a child task experiences an error, it can be caught by the parent who
may be able to compensate and continue processing.
Nested scopes are important for a number of reasons, including:
Fault-isolation: if sub-scope fails (e.g., because a service it was using fails) then
this does not require the enclosing scope to fail, thus undoing all of the work
performed so far.
Modularity: if there is already a scope associated with a call when a new scope is
begun, then the scope will be nested within it. Therefore, a programmer who
knows that a service requires scopes can use them within the service: if the
services methods are invoked without a parent scope, then the services scopes
will simply be top-level; otherwise, they will be nested within the scope of the
client.
When a child task completes it can either leave the business activity or signal to the
parent that the work it has done can be compensated later. In the latter case, the
compensation task may be called by the parent should it ultimately need to undo the
work performed by the child.
Underpinning the business activity model are three fundamental assumptions:
1. All state transitions are reliably recorded, including application state and
coordination metadata (the record of sent and received messages);
2. All request messages are acknowledged, so that problems are detected as early as
possible. This avoids executing unnecessary tasks and can also detect a problem
earlier when rectifying it is simpler and less expensive; and
3. As with atomic transactions, a response is dened as a separate operation and
not as the output of the request. Message input-output implementations will
typically have timeouts that are too short for some business activity responses. If
the response is not received after a timeout, it is resent. This is repeated until a
response is received. The request receiver discards all but one identical request
received.
Most workow systems do not distinguish compensate activities from forward
progress activities: an activity is an activity and it just does some work. If that
work happens to compensate for some previous work then so be it. In addition,
Chapter 7: Transactions
307
most services you will nd already have compensate operations written into their
denitions, like cancel seat reservation or cancel holiday and they dont need to
be driven by some other transaction/coordination engine that then sends prepare
or commit or roll back to a participant which then has to determine how to talk
to the service to accomplish the same goal.
Although similar in their goals, there are fundamental protocol differences between
the WS-BusinessActivity and Long Running Action models. From an application
programmers perspective it is very unlikely that you will notice these differences.
However, we will now briey cover these differences.
5.2.1. WS-BusinessActivity
The
WS-BusinessActivity
model
denes
two
sub-protocols,
the
BusinessAgreementWithCoordinatorComplete and BusinessAgreementWithParticipantComplete. The only difference is that in the case of
BusinessAgreementWithCoordinatorComplete the child scope cannot
autonomously decide to end its participation in the business activity, even if it can
be compensated. Rather the child task relies upon the parent to inform it when the
child has received all requests for it to perform work which the parent does this by
sending the complete message to the child.
A child activity is initially created in the active state; if it nishes the work it was
created to do and no more participation is required within the scope of the business
agreement (such as when the activity operates on immutable data), then the child can
unilaterally send an exited message to the parent. However, if the child task nishes
and wishes to continue in the business activity then it must be able to compensate
for the work it has performed (e.g., un-reserve the seat on the ight). In this case
it sends a completed message to the parent and waits to receive the nal outcome of
the parent. This outcome will either be a close message, meaning the business activity
has completed successfully or a compensate message indicating that the parent activity
requires that the child task reverse its work.
308
LRA must remain compensatable until an enclosing service informs the individual
service(s) that it is no longer required.
Listing 7 shows the WSDL for the Compensator (CompensatorPortType) and the
coordinator that drives it (CoordinatorPortType).
<wsdl:portType name="CompensatorPortType">
<wsdl:operation name="compensate">
<wsdl:input message="tns:CompensateMessage"/>
</wsdl:operation>
<wsdl:operation name="complete">
<wsdl:input message="tns:CompleteMessage"/>
</wsdl:operation>
<wsdl:operation name="forget">
<wsdl:input message="tns:ForgetMessage"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:portType name="CoordinatorPortType">
<wsdl:operation name="compensated">
<wsdl:input message="tns:CompensatedMessage"/>
</wsdl:operation>
<wsdl:operation name="completed">
<wsdl:input message="tns:CompletedMessage"/>
</wsdl:operation>
<wsdl:operation name="forgot">
<wsdl:input message="tns:ForgotMessage"/>
</wsdl:operation>
<wsdl:operation name="unknownCompensator">
<wsdl:input
message="tns:UnknownCompensatorFaultMessage"/>
</wsdl:operation>
<wsdl:operation name="cannotCompensate">
<wsdl:input
message="tns:CannotCompensateFaultMessage"/>
</wsdl:operation>
<wsdl:operation name="cannotComplete">
<wsdl:input message="tns:CannotCompleteFaultMessage"/>
</wsdl:operation>
</wsdl:portType>
Listing 7. The LRA Compensator WSDL
Chapter 7: Transactions
309
Let us consider the example of an online travel agent. The travel agent is concerned
with booking a taxi, reserving a table at a restaurant, reserving a seat at the theatre,
and then booking a room at a hotel. If all of these operations were performed as
a single transaction then resources acquired during booking the taxi (for example)
would not be released until the top-level transaction has terminated. If subsequent
activities do not require those resources, then they will be needlessly unavailable to
other clients.
Figure 7 shows how part of the night-out may be mapped into LRAs. All of the
individual activities are compensatable. For example, this means that if LRA1 fails or
the user decides to not accept the booked taxi, the work will be undone automatically.
Because LRA1 is nested within another LRA, once LRA1 completes successfully
any compensation mechanisms for its work may be passed to LRA5: this is an
implementation choice for the Compensator. In the event that LRA5 completes
successfully, no work is required to be compensated, otherwise all work performed
within the scope of LRA5 (LRA1 to LRA4) will be compensated.
310
Success: the activity has completed successfully. If the activity is nested then
Compensators may propagate themselves (or new Compensators) to the
enclosing LRA. Otherwise the Compensators are informed that the activity
has terminated and they can perform any necessary cleanups.
Fail: the activity has completed unsuccessfully. All Compensators that are
registered with the LRA will be invoked to perform compensation in the reverse
order. The coordinator forgets about all Compensators that indicated they
operated correctly. Otherwise, compensation may be attempted again (possibly
after a period of time) or alternatively a compensation violation has occurred
and must be logged.
Each service is required to log sufcient information in order to ensure (with best
effort) that compensation is possible.
So far we have not really considered the relationship between LRAs in an application.
Obviously LRAs may be used sequentially and concurrently, where the termination
of an LRA signals the start of some other unit of work within an application.
However, LRAs are units of compensatable work and an application may have as
many such units of work operating simultaneously as it needs to accomplish its tasks.
Furthermore, the outcome of work within LRAs may determine how other LRAs are
terminated.
An application can be structured to so that LRAs are used to assemble units of
compensatable work and then held in the active state while the application performs
other work in the scope of different (concurrent or sequential) LRAs. Only when
the right subset of work (LRAs) is arrived at by the application will that subset be
conrmed; all other LRAs will be told to cancel (complete in a failure state).
At the start of this chapter we mentioned that although the WS-Transaction and
WS-TransactionManagement specications share many things in common, the latter
specication possesses an additional protocol that the IBM, Microsoft and BEA
specications do not: the business process model. In the following section we will
briey talk about this model.
Chapter 7: Transactions
311
span messaging, workow and traditional ACID transactions. The reason for this is
to allow business to leverage their existing corporate IT investment.
In the business process transaction model all parties involved in a business process
reside within business domains, which may themselves use business processes to
perform work. Business process transactions are responsible for managing interactions
between these domains. A business process (business-to-business interaction) is split
into business tasks and each task executes within a specic business domain. A business
domain may itself be subdivided into other business domains (business processes) in
a recursive manner.
Each domain may represent a different transaction model if such a federation of
models is more appropriate to the activity. Each business task (which may be modeled
as a scope) may provide implementation specic counter-effects in the event that
the enclosing scope must cancel. In addition, periodically the controlling application
may request that all business domains checkpoint their state such that they can either
be consistently rolled back to that checkpoint by the application or restarted from
the checkpoint in the event of a failure.
An individual task may require multiple services to work. Each task is assumed to be
a compensatable unit of work. However, as with the LRA model, how compensation
is provided is an implementation choice for the task.
For example, let us return to our travel agent and see how it might be mapped into the
BP model. If you look at Figure 8 you can see that the on-line travel agent interacts
with its specic suppliers, each of which resides in its own business domain. The work
necessary to obtain each component is modeled as a separate task, or Web service. In
this example, the Flight reservation task is actually composed of two sub-tasks; one
that gets the ight and the other that gets the necessary travel insurance.
312
The user may interact synchronously with the travel agent to build up the details of
the holiday required. Alternatively, the user may submit an order (possibly with a
list of alternate requirements, such as destinations, dates, etc.) to the agent who will
eventually call back when it has been lled; likewise, the travel agent then submits
orders to each supplier, requiring them to call back when each component is available
(or is known to be unavailable).
The business process transaction model supports this synchronous and asynchronous
interaction pattern. Business domains are instructed to perform work within the
scope of a global business process. The business process has an overall manager that
may be informed by individual tasks when they have completed their work (either
successfully or unsuccessfully), or it may periodically communicate with each task to
determine its current status. In addition, each task may make period checkpoints of
its progress such that if a failure occurs, it may be restarted from that point rather
than having to start from the beginning. A business process can either terminate in a
conrmed (successful) manner in which case all of the work requested will have been
performed, or it will terminate in a cancelled (unsuccessful) manner, in which case
all of the work will be undone.
If it cannot be undone, then this fact must be logged. One key difference between
the business process transaction model and that of traditional 2PC is that it assumes
success: the BP model is optimistic and assumes the failure case is the minority and
can be handled or resolved ofine if necessary, or through replay/void/compensation,
but not always automatically, often requiring human interaction.
So far we have seen how useful transactions (ACID or not) can be when developing
distributed applications. However, throughout the previous descriptions there has
been an implicit assumption: a user can trust a transaction coordinator and a
transaction coordinator can trust the participants. In the sorts of closely coupled
environments where transactions originated these kinds of trust relationships are
possible. As you can see in the chapter or Security, in the loosely coupled SOA
environment, trust is something that cannot be taken as a given. In the next section
we will give a brief overview of the kinds of issues that could arise when trust is not
readily available.
6. Security Implications
There are several implicit security issues in the use of distributed transactions,
regardless of the model that is employed. As we have seen, in any of the transaction
models there are essentially three actors:
Chapter 7: Transactions
313
314
7. Interoperability Considerations
As you might expect, there are some interesting interoperability issues presented by
having multiple transactions specications. However, there are also interoperability
issues within the specications. So let us rst look at whether interoperability between
heterogeneous implementations of the same Web services transactions specication
is possible.
Unfortunately both WS-Tx and WS-TransactionManagement dene message exchange patterns for their various models that allow for vendor-specic enhancements.
For example, if we look again at the CoordinationContext structure dened by the
WS-Coordination specication and shown in Listing 2, we can see that there is an any
in the context. This is intended to allow for implementation specic enhancements
to the basic context. Individual implementations can add whatever information
they require in order to function, and this then extends to the WS-Transaction
specications that leverage the context.
Although it is possible to implement the various transaction protocols without
recourse to the extensibility elements of the contexts or messages, it is likely that some
vendors will use these to implement protocol optimizations. If these implementations
used the optimizations with some foresight for interoperability then they should be
able to continue to work in the absence of the extensibility elements (albeit in a less
optimized manner). However, we have yet to nd an implementation that does this,
i.e., those that use the extensibility, require it to be present in all messages in order
for the protocols to work. Obviously this signicantly affects interoperability!
So although interoperability by implementations of the same specications is possible,
it is not necessarily a requirement of all vendors. You should be careful when choosing
an implementation if interoperability is a requirement now or in then future.
If you thought interoperability within a specication was simple, then hopefully
it should not come as a surprise to learn that interoperability between the two
specications is more complex. Despite the fact that the specications share many
requirements and have models in common, the on-the-wire message formats and
WSDL are different. It is possible that as these specications evolve (neither of them
have yet to be ratied as a standard), they may move closer and perhaps even merge.
In the meanwhile, direct interoperability (where, for example, an ACID Transaction
two-phase participant can enroll with a WS-AtomicTransaction coordinator), is not
possible. However, there are some vendors (e.g., Arjuna Technologies, ATL) who are
working closely with both specications (and their authors) to provide products that
can opaquely to an application bridge between the different transaction protocols.
Chapter 7: Transactions
315
Although all of this might sound like we have a considerable way to go before
interoperability is a fact of life, it is worth remembering that there is another
type of interoperability that is at least as important, and which we can cater for
now: interoperability with (and between) existing legacy transaction systems. Both
WS-AtomicTransaction and ACID Transaction models are meant specically for
integration with back-end infrastructures easier.
Web Services are for interoperability as much as for the Internet. As such, interoperability of existing transaction processing systems will be an important part of
Web Services transactions: such systems already form the backbone of enterprise level
applications and will continue to do so for the Web services equivalent. Business-tobusiness activities will involve back-end transaction processing systems either directly
or indirectly and being able to tie together these environments will be the key to the
successful take-up of Web Services transactions. Leveraging existing infrastructural
investments in terms of transaction systems and services that use them are extremely
important, and both sets of specications are ideal for this purpose.
8. Summary
We have looked at the two main candidates vying for the title of Web services
transactions standard. All of the main Web services heavyweights are backing either
WS-Transaction or WS-TransactionManagement. Whether there a single standard
will ever evolve is unknown and is probably more in the realm of politics than
technology.
As we have seen, although ACID transactions are not for all Web Services because of
their blocking nature, they are still a requirement for some use cases, especially where
interoperability is important. Interoperability of heterogeneous ACID transaction
systems is now possible and has been an often unfullled requirement for many
enterprises for a long time. Although Web Services represent a new arena of
distributed system that is loosely coupled, potentially large scale and heterogeneous,
they are for interoperability as much as for the Internet. As such, interoperability of
existing transaction processing systems will be an important part of Web Services
transactions: such systems already form the backbone of enterprise level applications
and will continue to do so for the Web services equivalent.
Business-to-business activities will involve back-end transaction processing systems
either directly or indirectly and being able to tie together these environments will
be the key to the successful take-up of Web Services transactions. Web services will
operate as the glue between different environments (e.g., corporate domains) and
316
8
EVENT-DRIVEN
ARCHITECTURE
Early in many of our careers, we would have remembered the days of batch
systems, transaction processing monitors such as CICS and other components of
the mainframe that were used to run many mission-critical systems. As time passed
and Moores law provided us with the ability to double computing capacity every 18
months, we began to develop systems that provided information in real-time. With
increasing computing capacity, we were able to ignore the architecture principles
learned by our forefathers and instead preferred to create systems that did processing
inline. This had the effect of making systems over time less scalable and more
susceptible to outages especially when downstream services the application depended
on were unavailable.
Event-driven architectures are one of the few instances in which the real-world
benets of an architectural approach were realized before the hype. The phrase
event-driven architecture refers to applications and services that have the ability
to react to changes in conditions, regardless of whether the change is a failure in a
downstream system or a sudden change in the marketplace such as a meltdown on
Wall Street.
317
318
319
1. Overview
Event-driven architecture as a paradigm focuses on the notion of an event as its
primary abstraction. Events can be generally classied as any occurrence, activity
or change in state. Events also have attributes such as location (where it occurred),
interval (how often it occurred) and time (when it occurred). Events themselves
are usually processed with some form of delay, which affords the opportunity to
ignore particular events, delay response or immediately start processing. Abstracting
business activities into a event-driven paradigm will help enterprises scale and align
services with real world business process. Within the vast majority of enterprises,
event handling within applications occurs via messaging paradigms.
Traditional applications may use queuing products and interact with other applications on a request-reply basis. Applications in this scenario send a message (event)
to other applications via queues and wait for reply before continuing processing.
Application level queues in this scenario may decouple the transport layer from
a connectivity perspective but does not provide features to aid in scalability or
availability since both applications become coupled to each other in a point-to-point
interaction.
Usage of queues does not guarantee asynchronous application interaction. The
event-driven approach to service development has similarities with traditional objectoriented development but departs in subtle ways. The rst departure comes by the
techniques used to capture and model the business domain. The traditional objectoriented approach may start with a UML class diagram that captures objects and
their attributes. In this approach, the attributes determine their state and methods
describe an objects behavior. In an event-driven approach, modeling may start by
capturing the participants in an event, the roles they play in the specied scenario
and modeling of state transitions.
Classes and their relationships traditionally captured are discarded in pure eventdriven architectures. Within an event-driven approach, state is determined by event
binding amongst participants and not within an object itself. Likewise, constraints
on state transitions are modeled as conditional rejections. Events themselves have a
transactional nature to them when put into a state context in that they can become
classied as reversible or irreversible states.
Let us dive deeper into the details of being event-driven.
320
2. Events
Events can be loosely classied into the following categories:
Descriptive,
Prescriptive,
Factual, and
Assumptive.
Let us look into the details of each event classication.
2.1. Descriptive
Descriptive events are declarative in their approach and may be typically used to
classify scenarios. Events can be further grouped into hierarchies and can also serve as
aliases. For example, a participant (customer) in an event-driven scenario interacting
with a consumer order entry service may also be classied as an individual (if single)
or as a household (more than one person at the shipping address).
Descriptive events can also place participants into named groups (sets) as well as
leverage a set of criteria. For example, an income tax service may classify wealthy
Americans as those individuals who have an annual income greater than $40,000
per year and own a car. Events can belong to multiple groups at the same time. In
the preceding example, the subject could be separately classied as both wealthy and
American.
2.2. Prescriptive
Prescriptive events either serve to quantify or constrain. For example, a university
course registration service may constrain students (participants) to how many courses
they can take in a single semester. Constraints can either specify exact quantities or
lower and upper boundaries in terms of ranges or intervals.
Constraints are usually applied to events that have a limited duration from a time
perspective. For example, an insurance policy may constrain the reporting of physical
property damage to the effective date of the policy to ve business days after
the policy expiration date. Constraints can also be applied to contingent scenarios
321
whereby events are dependent upon a series of other events occurring. For example, a
product warranty may trigger an obligation to repair an appliance at no charge if the
product is damaged during normal product usage within one year from the date of
purchase provided that the consumer purchased additional warranty coverage within
ninety days of purchase.
2.3. Factual
Factual events are events that have occurred and can include both business and userinterface events. Business events include contractual events which specify the rights
(descriptive) and responsibilities (prescriptive) of each participant. Contractual events
are descriptive in that they incorporate denitions of the rights and responsibilities.
Contractual events are also prescriptive in they specify authorizations and obligations
on both parties. Factual events can also include workow events which demonstrate
the fulllment of responsibility.
2.4. Assumptive
Assumptive events are events that may or may not have actually occurred. They may
assumed to have occurred or anticipated to do so in the future. When the enterprise
wants to develop systems that are predictive in nature, it may allow for assumptive
events to be created. Sometimes it is useful for a semi-informed event to be created.
For example, an event monitoring service may need to may certain assumptions if it
receives multiple events that are part of a business transaction out of order. In this
situation, any actions taken by a service need to allow for events that later prove or
disprove the particular action taken.
322
Roles,
Conditions,
Events, and
Classication/Scenario.
Examples of participants in business rules are customers, suppliers, supervisors, etc.,
whose activities occur in context of a role such as purchaser, approver, or authorizers.
Business rules also have conditions such as under which circumstances can an
authorization event will be triggered. Usually the entire rule will occur in some
particular context/scenario and a classication scheme applied to it such as order
entry, quoting, claims submission, etc.
Traditional business rules processing however is usually implemented in short-lived
transactional scenarios. Event-driven architecture can be considered a superset in that
it captures the lifecycle of all policies (business rules). When a rule res, it only
maintains context from its entry point but otherwise becomes isolated from other
events within the enterprise. Sometimes it is necessary to understand the state of
transactions outside of the currently executing context. Rules such as the trading
service can only accept trades from six wealthy individuals concurrently that are
submit limit orders for after hours on securities that trade on NASDAQ and the last
trade was an up tick would be difcult at best to construct using a pure rules-driven
approach and would require tons of awkward logic.
Traditional approaches to rules engines operate on the notion of forward chaining.
Rather than specifying an expression for evaluation, the rule set is run against
the current knowledge base allowing it to assert the facts for each rule has it is
preconditions satised. Rules engines generally iterate until no rules have all of their
preconditions satised. The problem with this approach is that the knowledge base
is somewhat static in that another rule in another set may invalidate conditions that
would have caused the rule to execute.
Some rules engine implementations will allow a user to leverage backward chaining.
Backward chaining starts with just a set of preconditions and no assertions. The
engine will search the knowledge base to nd the facts that satisfy the constraints.
Backward chaining is useful for constraint-based searching and can result sets can be
returned iteratively instead of running to completion. Backward chaining is closer
in spirit to event-driven architecture but forward chaining has won the popularity
contest.
To learn more about Business Rules, we recommend Ross (2003).
323
3. Agents
Imagine a situation where a client from one enterprise wants to conduct dynamic
business with another enterprise in an integrated supply chain manner. The ability to
provide run-time integration and service provisioning at run-time is crucial. In this
particular scenario, if no particular service existed that could satisfy the functionality
required by the rst enterprise, there should exist the possibility of combining existing
services together in order to fulll the request.
One challenge that has not yet emerged within the enterprise is the ability to
understand the limitations of human capability to analyze the required services within
a transaction and create compositions using approaches such as BPEL manually. At
the heart of the matter is the notion of service composition as it is more complex
than it appears at rst and cannot be solved without good architectural discipline and
several degrees of automation.
Enterprise SOAs that are event-driven will introduce the notion of an agent. An
agent can launch several responses based on a business event, each of which can be
executed independently often requiring no further action from the initiating agent.
Agents can be congured statically or learn dynamically to watch for a range of events
that may or may not happen, and may occur in an order that is difcult to design for
upfront. Building applications and services that can be assembled in arbitrary ways
usually requires heroic efforts when not using an event-driven approach. Until now,
only a few services were constructed using event-driven approaches such as trading
applications but have now became realizable for the enterprise to incorporate into all
enterprise applications.
Before we jump into business events, agents and other advanced concepts, let us
revisit some of the principles we discussed in previous chapters and put them into an
event-driven context.
In Chapter 4, we learned techniques for describing and registering services. Many
typical implementations of registries permit services to be referred to by function
signatures that are somewhat opaque and provide virtually no indication of the nature
of the services being managed. Services themselves in their description, require a level
of expressiveness in order to work in an agent-based model. The description of a
service needs to include its meaning and intent rather than simply ascribing a name
to it.
324
The term Ontology is borrowed from philosophy and represents a systematic account
of existence.
For example, a semantically poor description of a service interface would be that it
takes as input an integer and three strings are returned as output. A semantically rich
description for this service interface would be that it takes the name of a company
and returns (i) the stock exchange it trades, (ii) the email address of the CEO, and
(iii) the CEOs shoe size.
325
326
Under service invocation, allow the agent to coordinate the activities of different
participants.
Provide the ability for the agent to monitor the execution of the service.
Service groundings state the details of how agents can access the service and will
contain information on which communication protocols to use, message formats
and other service-specic details required to interact with the service. The service
grounding also contains specications for how to exchange data elements for abstract
types contained within the service model. This could be a specication on how to
serialize/deserialize the data type.
Current service interactions typically show a client querying a centralized registry
(nd) to discover the location of a service endpoint (bind and execute). What is
not taken into consideration is the ability of a service provider to locate potential
consumers of a service and provide pieces of the puzzle to the client in which the
required interaction has not been predened. Architectures that are agent-based can
provide the opportunity for a service provider to become proactive in the service
composition process.
To learn more about agent-based approaches to services, visit http://www.daml.org.
327
The mindset within the enterprise needs to move away from the mindset of developing
infrastructure to support peak loads to developing services that are mission-critical to
be well-conditioned to handle load. A well-conditioned service has the characteristic
that when the number of requests exceeds its intended capacity, it will minimally not
over commit usage of operating system and downstream resources that ultimately
degrade the responses of all clients.
Services that can detect overload conditions and attempt to adapt their resources to
them can use strategies to shed load in a predictable fashion by returning a predened
response to the consumers when it is saturated or by degrading the quality of service
based on either amount of data returned and/or actual response times. Ideally, this
should be a congurable behavior within each service instance. The ability to inform
service consumers that the service is overloaded is far better than dropping service
requests.
The architecture used to develop services should also address:
Handling large variations in service utilization.
The ability to support massive concurrency of service requests.
Decoupling event handling and load management from service logic.
Allowing policies for load management to be congurable.
The ability to provide classication in a generalized manner to service requests.
There are many approaches that can be used in creating highly adaptable services that
realize the above goals. Some of the techniques that can be used are:
Resource Pools,
Multi-threaded Designs,
Soft References.
In order to understand how they can be implemented within an enterprise, we will
need to revisit several software engineering concepts and see how they can be applied
to an enterprise SOA.
3.2. Pools
Pooling mechanisms are useful in situations where resources are limited and can cause
performance bottlenecks where there are not enough resources to meet the demands
328
329
4. Threads
Many enterprise applications leverage frameworks and application servers that provide
a simplistic approach to simultaneously support multiple concurrent requests. These
frameworks hide the complexity of developing multithreaded applications from
developers and meet their goal of making application development simpler. In
most situations, the approach used by application servers and frameworks provide
a sufcient level of concurrency with appropriate response times. However these
same frameworks and application servers will most often fail in situations with
unpredictable load.
Modern operating systems support the notion of a thread of execution in which the
operating system determines what will execute. A thread executes in context of a
process. Processes are used to group resources together and threads are the resource
in which the operating system scheduler will schedule for execution on the CPU.
Usages of threads are a common approach to improving the parallelism of applications.
The operating system will rapidly switch execution of threads to give the illusion of
parallel execution. Threads like services can be in any of multiple states; running,
blocked, ready, terminated. Threads can be useful in applications that are required to
do more than one task at a time but can be detrimental in any application that has a
sequential process that cannot be divided into parallel tasks as they would block until
the previous one completes.
There are two pervasive approaches used in developing multithreaded applications:
1. Thread per Request, and
2. Thread Pools.
330
331
332
that are of a higher priority. Many application servers will solve the former problem
by segmenting pools based on the type of request but do not necessarily provide a
solution to the latter.
The usage of queuing via dispatching may help in some situations but since most
implementations of queues use rst-in, rst-out (FIFO), there is no ability to
support the prioritization of requests based on either business priority or resource
requirements. The dispatcher approach is also limited in that it cannot preempt a
busy thread for another thread that contains a request that uses less resources or of
higher business priority.
A clever enterprise developer may be able to develop a framework that solves
for the threading issues discussed to date, but this would be missing the entire
point. The author team recommends leveraging existing frameworks and application
servers where appropriate but to consider alternative approaches to commonly
used techniques that were held over from client/server, J2EE Blueprints and other
paradigms of the past.
5. Alternative Pattern-Based
Approaches
One approach that can be used to develop intra-service communications is to consider
leveraging several commonly used design patterns such as:
Strategy,
Chain of Responsibility,
Interpreter,
Flyweight, and
Memento.
For additional information on design patterns, we recommend Shalloway and Trott
(2004).
333
334
request. Objects are placed in a chain and the request is passed to each object until
one decides to handle it. The number and types of objects that can handle the
request are not known at design time and thus can be congured dynamically. The
approached used to chain objects typically use recursive composition to allow an
unlimited number of objects (handlers) to be linked together.
335
336
payload itself. Logic can be processed and tuned via conguration over time without
requiring recompilation.
In Figure 3, the UML class diagram demonstrates a small portion of a policy
administration system that could be used within the insurance industry. Using this
approach, a developer could quickly add additional functionality such as supporting
endorsements (additional coverages) that are not part of the standard policy process
by implementing it in a separate class without requiring changes to other aspects of
the system.
337
338
339
340
6.2. Forking
In certain situations, instead of taking on the difcult task of creating multithreaded
services, especially if you are not using an application server that provides a framework,
a simplistic approach may be to create new processes dynamically based on load. Web
servers such as Apache use this approach to create highly scalable, fair processing
HTTP services.
The ability to create new processes based on incoming requests provides the capability
to use third-party non-thread safe libraries for services. Creation of new processes per
request will also provide a level of isolation for each request so that if a problem arises
with a single request, it will not with others.
Services that use forking techniques will have a single control process that is responsible
for launching child processes which listen for connections and service client requests
directly. The control process will also maintain several idle server processes so that
clients do not need to wait for new child processes to be forked.
Fork is a feature of most operating systems that creates a new process. A forked
process will inherit various properties from its parent process.
341
still manage to not only keep their mainframes, but upgrade them on a frequent basis.
Mainframes still exist as viable platforms to build services, not due to their blazing
speed of execution (not!) nor the ability to support COBOL, but in their ability to
handle I/O better than any other computing platform.
Mainframe architectures have had the ability to virtualize hardware resources, which
is now only starting to become enterprise-class on other platforms. Most operating
systems do not provide the ability for any applications to participate in enterprisewide resource management decisions as services will typically execute across process
and sometimes even server boundaries. The only implementation that the author
team is aware of that affords this capability is IBMs Workload Manager.
342
343
344
6.5. Callbacks
Many event-based applications under the hood implement implicit invocation of
underlying services and limit asynchronous behavior at the service entry point. Usually
this occurs because event-based services make correctness reasoning more difcult
than simple procedural approaches. The ability to achieve further asynchronous
behavior within the service can be accomplished by allowing a service to register a
public interface for implementing callbacks.
Applications that subscribe to the principles of event-driven architectures when
they cannot complete an operation immediately will register a callback and defer
processing to a later time. Event-driven applications may poll for events and execute
the appropriate callback when the event occurs. Callbacks can be done at the
service interface or can even be implemented at each of the layers within an application.
345
A set of states.
Functions that map states and input to output.
Functions that map states and inputs to states (This is known as state transition).
Rules or conditions that must be met to allow a state transitions.
Finite state machines are limited in that they have a limited number (nite) of possible
states. It is possible, but not practical to construct an innite state machine due to the
inability to dene innite transitions and the rules that must be met between them.
Finite state machines use an initial state as a starting point and keep track of the
current state based on the last state transition. Input events serve as triggers which
cause a rule or condition to re that govern transition from the current state to future
state. Finite state machines are traditionally used in articial intelligence applications
and services and whenever semantic networks are constructed.
Finite state machines are similar to rules-based approaches in many ways. For
example, if all the antecedents of a rule is true then the rule is red. Only one rule
can re at a time. If the potential for multiple rules to re exists, then a conict
resolution strategy is required to determine which individual rule to select. This
ultimately results in a state transition.
346
347
8. Event Notication
Event notication is similar to publish/subscribe in several ways but can also be
considered its big brother. Publish/subscribe has been around for several decades and
is based on the paradigm of message routing. Messages are delivered to receivers based
on a set of criteria related to either metadata contained within the message or the
message content. The message sender has no awareness of message receivers and the
forwarding and delivery of messages is handled by middleware such as CORBA.
One or more notications are emitted by an event producer and received or retrieved
by one or more event consumers possibly through a broker.
Event notication unlike publish/subscribe adheres to a contract and uses the notion
of an event-sink to request asynchronous delivery of specic events from an event
source. Events can be considered an advanced form of callbacks in that they can
leverage two different models: the push model and pull model.
The push model allows for suppliers of events to push an event into the event channel
which is delivered to all consumers who registered interest in a specied event. The
pull model occurs when the consumer of a service requests an event from the event
channel which in turns requests the event from the supplier.
348
349
350
351
message even ten seconds before another party has a potential advantage. On the
receipt of bad news, the party may be able to sell their shares for less of a loss than
parties receiving the message later. For a stock that is quickly rising in price, the rst
party may be able buy the stock cheaper than other parties and make more money.
The ability to protect against message order alteration is difcult and may require
a mechanism for which no current specications are provided. In this particular
situation, one may have to resort to proprietary implementations of secured reliable
delivery channels and other mechanisms.
352
callback URL itself or even a message ID to encode the information it wishes to gain
access to.
Redirection can also be used to launch attacks and have the attacker cover its tracks.
Let us say that the quote service has a aw in how it handles large messages (buffer
overow) but also register a callback URL of another machine resulting in the
downstream service also potentially getting corrupted data and/or getting into an
endless loop.
Redirection attacks cannot be prevented by simple access control lists that state who
is authorized to access the service. In order to secure against this type of attack, the
security policy will need to be extended to also support the ability to specify where
responses can be authorized to be sent. Minimally, each service would need to be
designed where the services themselves exchange authorization information before
the entire message is sent (authorization should not be in the message itself ).
Redirection attacks can also allow for hijacking of credentials. It becomes important
that credentials are not transitive and can only be read by consumer and provider.
This requires that both consumer and provider use the same security provider or that
security providers are federated. Security in this situation should incorporate some
form of hashing algorithm.
If you want your services to experience hijacking, the best way to accomplish this is by
having developers be clever (being sarcastic here) in creating their own authentication
schemes such as inspecting headers and comparing IP addresses to a list of known
hosts.
To learn more about security, we recommend Ferguson and Schneier (2003).
9. Practical Considerations
Enterprises cannot realistically rewrite all of their applications, expose them all as
services, incorporate all the events, and change them to exactly match all the business
processes in a timely cost-effective manner so prioritization becomes crucial. The
authors have constructed a simple straightforward approach to prioritization and
have put them into four simple classications:
1. Return on Investment (Bang for the buck),
2. Canonical Form,
353
3. Integration, and
4. Retirement.
<color>rgb(255,255,255)</color>
Code 3. HMTL Example Two
The need to have message exchanges (especially XML-based) not only subscribe to
syntactic standards but a specication also describing the physical representation,
the canonical form is required. The requirement for canonical form aids not only
354
9.3. Integration
Using an event-driven approach allows one to arbitrarily add additional applications
into the supply chain without changing existing applications. New applications express
an interest in specic enterprise-level messages and handle responses accordingly. This
allows for the enterprise to add new applications at will and deal with previously
unknown situations. Customizations to existing applications can also be accomplished
in a loosely coupled manner.
9.4. Retirement
Taking event-driven approaches one step further will allow for the wholesale replacement of existing legacy applications with new ones. Minimally, when a consuming
application doesn?t need to have understanding of the producing application will
allow for its eventual replacement. Many enterprises desire to replace their CRM
investments but are in a conundrum since upgrading costs are obscene. In this
situation, the enterprise can replace the front-end of the CRM application using
355
standards-based approaches such as portals and write a services wrapper on top of the
CRM application to isolate changes in data.
The enterprise using this approach will rst replace the front-end of the CRM
application, working its way down the layers until it is able to wholesale replace the
persistence tier. Event-driven architecture should be incorporated into any retirement
strategy.
10. Summary
Event-driven architecture and service-oriented are distinct yet compatible concepts.
The agile enterprise will require both. In constructing an enterprise service-oriented
architecture, the enterprise will need to sense and respond to events as they occur
rather than carry out predetermined processes developed using information based on
historical occurrences.
In this chapter, we have learned how Service-Oriented Architectures provide the
potential to improve the efciency of IT systems and service offerings. While this
book covered the technical know-how of how SOA can be realized, it is simply not
enough to guarantee success. In order to be successful realizing an enterprise SOA
one needs to be skilled in management and enterprise architecture. Enterprise SOA
needs to be backed with the proper organizational structure, strong governance and
agile software development approaches.
To learn more about governance, visit the IT Governance Institute at:
http://www.itgi.org.
Enterprises that expect to use technology to gain and retain competitive advantage in
the marketplace must adopt a business-driven event-based service-oriented architecture. Enterprises that have already started down the path have a distinct advantage
over their peers. Enterprises that are just starting the journey to implementing
an Enterprise SOA are well positioned to be fast followers. By learning from the
experiences of others, their successes and failures, enterprises will be able to build
the extended enterprise realizing the holy grail of lower total cost of ownership and
business agility.
OUTTRO
How few there are who have courage enough to own
their faults or resolution enough to mend them.
Benjamin Franklin
One of the most challenging aspects of writing a book on a vast topic like serviceoriented architectures is knowing when the book should be published. Within
the minds of most authors, books are never really complete. Authors are doubly
challenged with the fact that they too may be consumers of books such as the one
you hold in your hand. We too get upset when we spend our hard earned money and
a book does not 100% answer all of our questions.
One of the challenges we faced while creating this book is whether it should cover
topics of the moment that corporations are currently struggling with such as whether
I should use SOAP internal to my enterprise. We took the stance, right or wrong that
questions such as these are more appropriate for magazine articles and discussions
with industry analyst rms. We felt that a book should not cover the issues of the
minute but instead present information that is timeless in nature.
The authors also wanted to cover other aspects of service-oriented architectures but
would have never nished the book if we kept adding to it. In order to be fair to both
parties, we have decided to take a different approach. For purchasers of this book
who register, we will be sending supplemental information in ebook format for no
additional cost in hopes that we can not only meet your unstated desires in spending
large sums of money to acquire knowledge, but to exceed it by leaps and bounds.
The ebook will discuss the following topics that are near and dear to your heart and
criteria for success:
Developing SOAs using the Enterprise Service Bus patterns,
Integrating SOAs with Business Rules Engines,
357
358
APPENDIX A:
UNDERSTANDING
DISTRIBUTED COMPUTING
Man has such a predilection for systems and abstract deductions that he is ready to distort
the truth intentionally, he is ready to deny the evidence of his senses only to justify his logic
Fyodor Dostoevsky
The idea of service-oriented architectures have been around for over a decade and have
been incorporated into many of the technologies that are pervasively used including
the worldwide web, email and FTP. These concepts when applied to business, allow
a new generation of enterprise applications to be created. SOA addresses many of the
shortcomings in previous old world architectures based on monolithic independent
applications.
Enterprises that leverage service-oriented architectures can bridge the traditional gap
existing between business requirements and IT capabilities by providing the ability
to nd, bind and execute to providers of choice. SOA can help the enterprise with
business goals that are based on technology in many ways including, but not limited
to:
Faster time to market,
Less expensive application integration,
Easier software construction,
Ability to leverage existing IT investments, and
And more
359
360
The rapid adoption of SOA is leading a shift in how enterprises leverage computing
resources and deliver services to users. It is helping to provide tighter integration and
alignment between business drivers and IT implementation. The ability unlock the
assets contained with enterprise applications and provide the capability to mix and
match services regardless of whether they reside within the enterprise or are provided
by third-parties will allow IT to increase their own value to the enterprise.
Let us start with understanding the technical benets of SOA and how it is based on
the fundamentals of distributed computing.
1. Distributed Computing
Distributed computing is one key component in enabling the creation of the extended
enterprise.The ability to have humans and systems interact with each other regardless
if they reside within the same company or are located on the other side of the planet
connected via the Internet has been a reality for many years now. The ability to
interconnect systems via network using thousands of personal computers and various
forms of networking technology has been commoditized.
Distributed computing is the ability to break down an application into discrete
computing components that can be executed across a network of computers so they
can work together to perform cooperative tasks. There are many approaches that can
be used to accomplish this goal.
In this chapter, you will learn about the foundational principles used to distribute
application execution across a network including:
The anatomy of a distributed application.
Remote Procedure Calls.
Object Request Brokers.
Transaction Monitors.
Message-Oriented Middleware.
361
362
363
responsibility is to decide where data should be sent. Because this layer is not
concerned whether packets get to their nal destination or the order in which packets
arrive, its job is greatly simplied. If a packet arrives corrupted, the network layer
simply discards it. The network layer requires that every network interface have a
uniquely dened address. If the network layer is based on TCP/IP the uniquely
dened address is known as the IP address.
The transport layer provides data ow (state) for the application layer where required.
This layer performs guarantees of reliable delivery and ordering. Two of the more
popular protocols in use at this layer are Transmission Control Protocol (TCP) and
User Datagram Protocol (UDP). TCP provides end-to-end reliable communication.
TCP creates virtual circuits between two processes and ensures that packets are received
in the order they are sent (sequencing) and that lost packets are re-transmitted.
The application layer is where user applications interact with the network. Protocols
such as Telnet, FTP, Email, IRC and others interoperate. Applications can use
either/both TCP or UDP to communicate with other computers.
Let us look at a basic scenario on how TCP/IP is used within a Telnet application:
1. A user desires to connect to a machine via telnet named foxbat.soa.edu.
2. The machine name is converted via Domain Name Server (DNS) to an IP
address (192.168.0.6).
3. Telnet informs the transport layer it wants to start a TCP connection with
192.168.0.6 on port 23.
4. TCP establishes a conversation with foxbat and uses IP to route packets.
5. Telnet retrieves a port number from the users machine (say, 1742) and TCP
places the source and destination ports in its packet header.
6. The packet is now handed to the network layer where IP routes the packet to the
link layer.
7. The link layer takes the packet and places it on the network where it is transmitted
via routers and switches to the Internet.
8. The process is repeated, one router at a time until it reaches the network segment
in which foxbat is located on.
9. foxbats TCP layer replies in a similar manner as outlined in step 8.
10. The telnet daemon on foxbat and the telnet client exchange terminal information
and other parameters required for establishing an interactive session.
364
11. Control messages are sent in-band as an escape byte of 255 followed by a control
byte. Control messages include: echo, status, terminal type, terminal speed, ow
control, linemode and environment variables.
12. The user sees the login prompt from foxbat. After the login process is completed,
data is sent back and forth until the session is terminated.
The benet of layers, as originally envisioned by the inventors of TCP/IP, is that the
network and transport layer would only have to be written once for each protocol.
They would then provide a common interface to the network layer by writing
different device drivers for each kind of network interface.
The principle of layering is pervasive in the vast majority of widely adopted
architectures and adds simplicity. For TCP/IP, the transport layer provides a standard
interface; network services that leverage the interface do not need to be rewritten or
even recompiled if the transport layer code changes.
For more information on TCP/IP, see ftp://ftp.internic.net/rfc.
Presentation
The presentation layer includes the user interface to an application and can use
either a rich or thin-client approach. Rich client interfaces provide full access to
the underlying operating system user interface components. Thin clients leverage
markup languages such as HTML and XML and provide benets of portability and
looser coupling at the expense of user interface expressiveness.
365
Business Logic/Services
The business logic layer incorporates your applications business logic and provides a
well-dened interface to the presentation layer services. Business logic within many
enterprises is typically hosted within an application server that allows the logic
to support multiple simultaneous clients. The application servers themselves may
also provide support for pooling of business logic in order to increase efciency at
run-time as well as protect selected portions of business logic from those who are not
authorized to access specied processes.
In UML terms, the Actor can be a user interface (web browser, telephone, etc) or
another system. The actor will issue a service request, which is dened as an event.
This event is routed to the responsible business process component for execution
366
367
one can understand how applications and services that will execute on top of them
can take advantage of the layered approach. Let us look at these three components.
Processes
A process is an instance of an application that is capable of running on one or more
CPUs and contains a sequence of steps that the computer executes. A process also
provides context that controls access to resources of the computer (CPU time, I/O,
etc) via operating system calls. A process can initiate one or more sub-processes,
which is called a child process. The child will refer to the process that initiated it
as its parent. A child process is a replica of the parent process and shares many of
its resources and is terminated when its parent is terminated. An application can be
made up of one ore more processes. Likewise, a process can contain one or more
applications.
Threads
A process is comprised of at least one thread of execution. All modern operating
systems support the creation for multiple threads of execution within a single process.
Each thread within a process can run independent of other threads but in practice
usually require some form of synchronization amongst them.
Network-aware server applications are almost always developed as multi-threaded
applications whereby a group of threads may be dedicated to monitoring input from
a socket connection (users who are attempting to connect) while another group of
threads may be dedicated to actual processing of logic. Synchronization is required
when threads need to coordinate the transfer of data from the business logic portion
of the application and send a response back to the requester.
When developing a multithreaded application, the number of simultaneously running
threads can only be one for one with the actual number of CPUs. When there are
more threads that desire to execute, the operating system will perform a context
switch that allows other threads the opportunity to execute. Context switching is a
core element of operating systems and occurs at both the process and thread levels.
Context switching between two threads in a single process is lighter weight than a
context switch between two processes.
Objects
Applications that were created using modern object-oriented languages are comprised
of cooperating objects.A process is composed of one or more objects and one or more
threads within a process access these objects. Objects themselves can be distributed
across multiple systems within multiple processes using technologies such as CORBA,
DCOM and RMI.
368
Signals
Signals are used to signal asynchronous events between processes. A process may
369
implement a signal handler to execute when an event occurs or may use the system
default actions. Most signals received by an application can be ignored but some are
required to be implemented. For example, within Java when a user wants to get a
thread dump they can execute a kill 3 pid where pid is the operating system process
ID. Likewise, to terminate an application, you would execute kill 9 pid that would
terminate the process.
Semaphores
Semaphores are counters that are used to control access to shared resources accessed
by multiple concurrent processes. Semaphores are frequently used as a locking
mechanism to prevent processes from accessing a specied set of resources while
another process is performing operations on them. Semaphores are a special function
of the operating system kernel that each process can check and usually implemented
as sets. Semaphores are common used to either share a common memory space and/or
to share access to les.
Shared Memory
Shared memory provides the ability to map an area of memory into the address
of more than one process. Shared memory is usually the best performing method
for interprocess communication as processes do not need access to operating system
kernel resources to share data. For example, a client process may send data to a server
process in which would be modied and returned back to the client. Using other IPC
mechanisms would require the client to write a le and the server to read it requiring
kernel services. By using shared memory, the client would put data in shared memory
370
after checking a semaphore value, writes the data to the shared memory area, and
then resets the semaphore to signal the server that data has changed. The same process
would occur with the server notifying the client of changes in data.
Sockets
Sockets provide two-way (full duplex) method for interprocess communication
between client and server processes in a network. Sockets can also be used to
communicate between processes on the same system. A socket is an endpoint of
communication to which a name can be bound. Sockets can either be stream-based
or datagram-based. Stream-based sockets provide guaranteed delivery and ensure
sequenced unduplicated receipt of packets. Datagram sockets do not guarantee
delivery or sequence and may allow for duplicated packets to exist but are usually
faster at the network layer.
371
on
the
Proxy
pattern,
see
http://c2.com/cgi/
RPC can be used in client/server applications where the client can issue a service
request and wait for the response from the server before continuing its own processing
logic (blocking). Most implementations of RPC are not well suited to handle peer-topeer, asynchronous or object-oriented programming and should be avoided in these
situations.
372
373
Description
Denes how objects and components are created and destroyed.
Persistence
Provides the ability to store data used by the service using a backing
store such as a relational database and/or le system.
Allows a component to locate another component by name and
can optionally be used to leverage existing naming services such as
NIS or DCE.
Components can register interest in receiving notication of
selected events.
Naming
Events
Concurrency control
Transaction
Licensing
Properties
Security
Time
374
375
376
377
1.9. Versioning
In the real world, an enterprise will create different versions of its software and services
on a periodic basis. A service over time will increase the functionality provided to
consumers. Supporting multiple versions of a service is different than the traditional
methods used in support of multiple versions of a product due to loose coupling
between layers and the separation of producer from consumer. It becomes important
to support the formal evolution of services, which can be accomplished via a variety
of mechanism including, but not limited to:
Making interfaces immutable and dening a new interface for each change in
service.
Creating a document-style interface that allows a document to be passed to the
service which contains versioning information.
Allowing interfaces to be mutable and requiring clients to stay synchronized
with changes.
Making interfaces immutable is a technique used by Microsofts Component Object
Model (COM) and helps prevent run-time binding errors by ensuring that clients
always have access to a stable interface. Interface immutability will allow a client to
bind to a specic version of an interface or if one is not specied, the client will be
bound to the most current version.
Document passing is another technique where either a serialized string or value object
is passed from the client to the service. The service itself takes on the responsibility
for checking within the document, the actual version the client passed and making
sure it is supported and syntactically valid. If it is not valid, the service itself will
throw a fault. Defensive coding will usually require making a copy of the document
before processing.
378
If you control both the producer and consumer of services then you can change
interfaces at will and upgrade accordingly. This strategy however is fraught with issues
if the service will be consumed outside of your administrative control.
Minimal support for versioning of XML-based services should adopt an approach
that leverages unique XML namespace URIs.
Techniques for each of the three choices have been discussed in previous chapters.
1.10. Operations
Distributed computing platforms usually provide a mechanism for describing network
services as collections of communication endpoints that support message exchange
along with an abstract description of actions supported by the service.
Web services for example use the Web Services Description Language (WSDL) to
describe operations across multiple services and capture this information using XML
in a WSDL document. WSDL dened services as a collection of network endpoints
and separates the abstract denition of endpoint and messages from their concrete
deployment and data format.
Service operations can occur using both RPC-style and message-passing (document
style) bindings. When operations use RPC-style, it becomes important to mirror the
underlying interfaces signature since order of parameters becomes signicant. For
document style, list of parameters do not require the sender to adhere to a particular
parameter order.
Typically, transmission of messages across a distributed computing environment can
be classied in to one of four categories:
1. One-Way,
2. Request-response,
3. Solicit-response, or
4. Notication.
The above four primitives are better known as primitives and are represented in
abstract terms. Understanding the basics of each of the four primitives is crucial to
services. For example, some endpoints may only received messages if they are the
result of a synchronous request/response operation while others can interoperate in
an asynchronous manner. Let us look in detail as to how each of these operations can
be dened using WSDL.
379
1.10.1. One-Way
A one-way operation sends data to an endpoint but does not expect any form of
response. This form of operation is typically seen in message-queue-based architectures
that allow clients to send and forget. Example grammar for a one-way operation is
shown below.
<wsdl:definitions ... >
<wsdl:portType ... > *
<wsdl:operation name="nmtoken">
<wsdl:input name="nmtoken"? message="qname"/>
</wsdl:operation>
</wsdl:portType >
</wsdl:definitions>
Code 1. One-way operation
In the above example, the portType element species a set of abstract operations. The
input element species the abstract message format for the one-way operation. The
name attribute of the input element denes a unique name for the operation. If it is
not specied, the name defaults to the name of the operation with the operation type
appended.
1.10.2. Request/Response
A request-response operation sends data to an endpoint and expects either a successful
response or a fault to be returned. This form of operation is typically seen in scenarios
where interaction between two services is synchronous in nature. Example grammar
for a request-response operation is shown below.
<wsdl:definitions ... >
<wsdl:portType ... > *
<wsdl:operation name="nmtoken" parameterOrder="nmtokens">
<wsdl:input name="nmtoken"? message="qname"/>
<wsdl:output name="nmtoken"? message="qname"/>
<wsdl:fault name="nmtoken" message="qname"/>*
</wsdl:operation>
</wsdl:portType >
</wsdl:definitions>
Code 2. Request/Response Operation
380
The input and output elements specify the abstract message format for the request
and response, respectively. The fault element is optional and specied the abstract
message format for any errors that may be returned by the service as a result of the
operation. Each element within the fault must be named to allow a binding to specify
the concrete format of the fault message. The name of the fault element is unique
within the set of faults dened for an operation.
The request/response operation must specify a particular binding to determine how
messages are actually sent within a single service conversation (such as HTTP
request/response).
1.10.3. Solicit/Response
A solicit/response operation receives data from an endpoint and returns a successful
response or a fault. This form of operation is similar to request/response in that it is
synchronous in nature. Example grammar for a solicit/response operation is shown
below.
<wsdl:definitions ... >
<wsdl:portType ... > *
<wsdl:operation name="nmtoken" parameterOrder="nmtokens">
<wsdl:output name="nmtoken"? message="qname"/>
<wsdl:input name="nmtoken"? message="qname"/>
<wsdl:fault name="nmtoken" message="qname"/>*
</wsdl:operation>
</wsdl:portType >
</wsdl:definitions>
Code 3. Solicit/Response Operation
The output and input elements specify the abstract message format for the solicited
request and response, respectively. The optional fault element species the abstract
message format for any errors that may be returned from the service.
1.10.4. Notication
A notication operation receives data from an endpoint but does not send any form
of acknowledgement. This form of operation is typically used to implement callback
mechanisms for asynchronous processing. Example grammar for a notication
operation is shown below.
381
382
Shared nothing clusters provide each member server with its own memory and disks
and use disk mirroring technologies to provide access to shared state. Hybrid models
also exist where shared nothing architectures are ran on top of shared disk hardware.
While only a single member server can access the disk at a time, it provides seamless
failover in that another server can pickup the workload via checkpoint processes.
Cluster architectures have common attributes in how they operate and can be
generally classied into four categories:
1. Active/Active,
2. Failover/Failback,
3. Switchover, and
4. Impersonation.
Active/active clusters require each server to run its own workload and can assume
responsibility for another cluster member in the event of a failure. Failover/failbackbased cluster will automatically transfer the workload of a failed server to another
cluster member until the rst server recovers, at which time its workload is
automatically transferred back.
Clusters may also use switchover approaches that allow clients to nd replacements
for failed cluster member servers with a minimum of service disruption. Usually
this approach requires a server to stand in for another server by taking over the IP
address of a failed server. Impersonation allows clients to nd a replacement server
and reroutes network trafc intended for the failed server to the replacement server.
383
384
385
2. Practical Considerations
Distributed computing is difcult because it requires services to be constrained by
the real world at each service/network boundary. Whenever a service interacts with
other services and handles client requests, it also has to correctly handle a variety of
conditions that may or may not be known at code time.
A distributed computing environment can reduce the potential number of errors a
developer will face by providing layers of abstraction. For example, a service may
return ve different errors but a developer may want to abstract the details of the
error away and simply think about success or failure.
Tim Berners-Lee when inventing the worldwide web realized that broken links are
OK. The same thing can be said of developing web sites, cities or services. Successful
service-oriented architecture is always on the border of chaos. Broken services are
inherent to any complex adaptive system. The key to building an enterprise SOA are:
Get the basics right.
Prefer working software over intellectually pure pursuits of architecture.
Merciless refactoring.
Put yourself in the shoes of the city planners for New York City. If they ever sought
perfection, the city would never exist or have been a total failure. The truth of the
matter is that New York City has only had a single electric blackout, water always
ows (sometimes even overows during Super Bowl half-time), and people get ran
over by taxis, there is always construction and potholes that are in need of repair. The
strategy for creation of services cannot be thought of in a big all encompassing plan
upfront but needs to evolve over time to support the ever-changing needs of its users.
An SOA is never complete and is always in the constant state of change.
Creation of an enterprise SOA does not require perfection but does require attention
to detail, careful planning and informed opinion. The most successful services are
the ones that exist.
3. Summary
In this chapter, we have learned about:
Business rationale for service-oriented architectures.
386
APPENDIX B:
QUALITY ATTRIBUTES
1. System Qualities
System qualities are the attributes of architecture that dene characteristics of how
the system shall behave and/or its structural aspects should be implemented. The
design of distributed computing architectures requires balance between competing
system qualities. The ve system qualities that are most important to incorporate
early as design goal are:
1. Availability,
2. Manageability,
3. Performance,
4. Scalability, and
5. Security.
Let us look at each of the ve system qualities.
1.1. Availability
Enterprise applications and services typically depend on multiple servers that may
be accessed by thousands of users and use internal networks to connect to relational
databases and legacy systems and even may leverage services outside the enterprise
387
388
connected via the Internet. This may be composed of multiple infrastructure components that must operate in a predictable uniform manner. When any component
within the enterprise applications nervous system fails, the interruption could result
in loss of business revenue, tarnish the brand of the company, and deny customer
access to data needed to perform customer self-service requests or other serious
outcomes. Creation of a highly available distributed computing architecture becomes
part of the business strategy.
Not all applications and services require 24 7 uptime with instantaneous response
times. Some can support failure with zero consequences while other applications
may be tolerant to unplanned downtime but require varying recovery approaches.
Few mission-critical applications and services must provide high availability and use
technology that supports replication to ensure instant, near real-time transparent
recovery with no signicant downtime.
Local application failures can usually be handled in an expedient manner. It becomes
progressively more difcult to avoid failure, as software will always be used in
scenarios above and beyond its original design supported. Typically, one or more of
the following reasons can cause failures:
Inadequate software testing.
Lack of a real change management discipline.
The inability to monitor the environment in real-time.
No tools that allow for performing long-term trend analysis.
Lack of quality software engineering processes.
Operating environment failure (hardware failure, disaster, re, ood, storms,
cooling).
Sudden changes in usage levels.
Based on our experience with several Fortune 100 enterprises, listed in Table 1 are
breakdown percentages of failures.
Availability is typically a measure of how often an application and/or service is
available for usage and is a percentage calculation based on how often the application
is actually available to handle service requests when compared to the total planned
run-time. The formal calculation for availability includes time for system maintenance
because an application during this period is unavailable for use.
As higher levels of availability are achieved, hardware costs for service execution
will increase due to server CPU utilization, network throughput and disk storage
389
Percentage
25
20
20
15
10
5
5
and redundancy. The discovery and identication of bottlenecks at higher levels will
also require higher-skilled developers who have a skilled understanding in software
engineering. Finally, higher levels of availability require automated comprehensive
testing of every service that may affect your application at run-time.
1.2. Manageability
Distributed applications and services make customer access and data exchange with
business partners easy but come at the expense with the difculty in diagnosing
and resolving capacity and resource access issues in a production environment.
Quality assurance also becomes a run-time requirement that may introduce the need
to perform audits and incorporate ndings into maintenance upgrades. This can
become difcult in infrastructures that are distributed across large geographic areas.
It becomes important to incorporate at design-time, interfaces that will allow not only
for operational quality assurance but the continuous measurement of service health
including such factors as resource consumption, faults, and statistics on consumer
service requests and overall service performance.
1.3. Performance
In many enterprises, there is a widely held belief that performance and scalability
are interchangeable terms when it reality they describe two different problem spaces
and can be in many situations opposing. Performance is usually not apparent until a
particular instance of a service is put under an increased load.
390
1.4. Scalability
Scalability must be designed into a service early in its lifecycle, as this is the hardest
attribute to support after the fact. Decisions made during design and early coding
phases will dictate how well your services scale. Scaling of services also requires
working knowledge of the deployment environment as it has dependencies on the
underlying hardware.
Hardware-based scaling can be accomplished by scaling up which requires adding
resources such as more memory, faster and/or more processors or even migrating to
a newer class of machine. Typically, this approach permits some scalability increases
without requiring changes to source and keeps administration simpler.
Scaling up can also have the effect of moving the bottleneck from one component to
another. For example, a server that is at 99 percent CPU utilization could increase
capacity by adding another CPU. However, this may shift the bottleneck from the
CPU to the system memory. Adding CPUs does not increase performance in a linear
fashion. In most servers, the performance gain curve tapers off as each additional
processor is added. Minimally, in order to take advantage of adding multiple CPUs,
your services should support multiple threads of execution.
Scaling out provides a different alternative to scaling up and hopes to leverage the
economics of using commodity hardware to distributed processing across multiple
smaller servers. Although scaling out is achieved by using many servers, the collection
functions as a single resource. By dedicating multiple machines to a common task,
service fault tolerance is increased at the expense of additional administration.
Scaling out provides a mechanism that results in near linear increases in scalability
as more servers are added. The key attribute to achieving scaling in this manner
is location transparency. Application code must not know what server is executing
the service. In some rare situations, it is still possible to scale out when applications
are aware of what servers are executing services. This situation is known as location
afnity. Location afnity requires changes to code to scale from one server to many. It
is easier to design services with location transparency at design time than refactoring
later.
391
1.5. Security
The ability to provide security in a distributed computing environment is all about
controlling access to a variety of resources (services, data, conguration, etc.). There
are four main concepts on which security practices and providers are based:
1. Authentication,
2. Authorization,
3. Data Protection, and
4. Auditing.
Authentication is the process of conrming the identity of the caller and/or service.
Before a service permits access, it may require conrming the identity of the service
requestor. The requestor establishes an identity by providing a credential that is
known only to the requestor and the authenticating service. In some situations, the
requestor may also desire to validate the identity of the authentication service, which
is known as mutual authentication.
Authorization is the process where verication of the authenticated party has the
appropriate permissions to access a specied resource. You cannot assume that because
someone has been authenticated that they are authorized for all actions.
Data protection is the process of ensuring the condentiality, integrity and nonrepudiation of data. Data, whether contained within a message in transit or on disk,
requires protection. Encryption assists in protecting the condentiality of data and
renders it useless to parties who lack knowledge of which cryptographic algorithm
was used and the key. Data integrity is realized through the use of hashing algorithms,
digital signatures and message authentication codes. Auditing is the process of logging
of security related events and can be used for forensic purposes.
2. Design vs Run-Time
Quality attributes are properties that govern how a system behaves over and above
its functionality. There are two categories of quality attributes, those that can be
determined at run-time and those that can only be estimated through inspection. It is
the prime responsibility of architects to ensure that all systems within their portfolio
have identied quality attributes and they are prioritized to those of which are most
important.
392
Description
The ability for a system to be constructed using the budget, time and staff
available for the project in many cases is simply too ambitious to be completed
given project constraints.
Conceptual integrity The ability of the architecture to communicate a clear, complete vision for
the system. Using agile methods, this is typically realized using metaphors. If
it does not feel right, then conceptual integrity is lost.
Integrability
Systems over time will need to integrate with other systems. The Integrability
of a system depends on the extent in which the system uses open standards,
how well APIs are designed and the usage of approaches such as serviceoriented architectures.
Modiability
Portability
Reusability
Security
Subsetability
Testability
How easily can a system be tested using human effort, automated testing
tools, code reviews and inspections and other forms of ensuring system
quality.
393
In Table 2, the system qualities that can be evaluated at run-time are given, whereas
Table 3 shows the system qualities that can only be reasonably evaluated through
inspection.
The quality of an enterprise SOA is directly proportional to the quality incorporated
into the enterprise architecture. A thorough understanding of system qualities not
only for services but all components of an architecture will result in lower total cost
of ownership and increased business agility.
APPENDIX C:
REFERENCES
It is amazing what can be accomplished when nobody cares about who gets the credit
Robert Yates
Books
Alur, D., Malks, D. and Crupi, J. (2003) Core J2EE Patterns: Best Practices and Design
Strategies. Prentice Hall.
Atkinson, C. et al. (2002) Component-Based Product Line Engineering with UML.
Addison-Wesley.
Beer, S. (1979) The Heart of Enterprise. Wiley.
Bernstein, P.A. and Newcomer, E. (1997) Principles of Transaction Processing. Morgan
Kaufmann.
Buschmann, F., Meunier, R., Rohnert, H., Sommerlad, P. and Stal, M. (1996)
Pattern Oriented Software Architecture, Volume One. John Wiley and Sons.
Clements, P. and Northrop, L. (2002) Software Product Lines. Addison Wesley.
COD (1982) The Concise Oxford Dictionary. Oxford University Press.
Eeles, P. and Sims, O. (1998) Building Business Objects. Wiley.
Farley, J. (1998) Java Distributed Computing. New York: OReilly.
Ferguson, N. and Schneier, B. (2003) Practical Cryptography. John Wiley & Sons.
395
396
Gamma, E., Helm, R., Johnson, R. and Vlissides, J. (1994) Design Patterns: Elements
of Reusable Object-Oriented Software. Addison Wesley.
Gamma, E. et al. (1995) Design Patterns. Addison Wesley.
Gray, J. and Reuter, A. (1993) Transaction Processing: Concepts and Techniques.
Morgan Kaufmann.
Guttman, M. and Matthews, J. (1998/1999) Migrating to Enterprise Component
Computing. Cutter Consortium.
Harmon, P., Rosen, M. and Guttman, M. (2001) Developing E-Business Systems and
Architectures. Morgan Kaufmann.
Herzum, P. and Sims, O. (2000) Business Component Factory. Wiley.
Hubert, R. (2002) Convergent Architecture. Wiley.
Greeneld, J. and Short, K. (2004) Software Factories. Wiley.
Keen, M. et al. (2004) Patterns: Implementing an SOA Using Enterprise Service Bus.
IBM Redbook.
Lawson, M. (2003) Finite Automata. CRC Press.
McGovern, J., Bothner, J., Cagle, K., Linn, J. and Nagarajan, V. (2003) XQuery Kick
Start. Sams Publishing.
McGovern, J., Ambler, S., Stevens, M., Linn, J., Sharan, V. and Jo, E. (2003) A
Practical Guide to Enterprise Architecture. Upper Saddle, NJ: Prentice Hall.
McGovern, J., Ambler, S., Caserio, C., Narayan, N., Tyagi, R. and Biggs, M. (2004)
Agile Enterprise Architecture. Connecticut: Manning Publications.
Morgan, T. (2002) Business Rules and Information Systems: Aligning IT with Business
Goals. Boston, MA: Addison Wesley.
Pawson, R. and Matthews, R. (2002) Naked Objects. Wiley.
Rector, B. (2003) Introducing Longhorn for Developers, chapter 3. Microsoft.
Appendix C: References
397
Robinson, M., Tapscott, D. and Kalakota, R. (2000) e-Business 2.0: Roadmap for
Success. New York: Pearson Educational.
Ross, R.G. (2003) Principles of the Business Rule Approach. Addison Wesley.
Shalloway, A. and Trott, J. (2004) Design Patterns Explained: A New Perspective on
Object-Oriented Design, 2nd edition. Addison Wesley (rst edition 2001).
Sims, O. (1994) Business Objects. McGraw-Hill.
Taylor, D.A. (1995) Business Engineering with Object Technology. Wiley.
Magazines
Mehta, T. (2003) Adaptive Web Services Management Solutions. Enterprise Networks
& Servers Magazine, May.
Petzold, C. (2004) Create Real Apps Using New Code and Markup
Model. Microsoft MSDN Magazine, January (http://msdn.microsoft.com/
msdnmag/issues/04/01/Avalon/default.aspx).
Docs
Abrahams, A.S., Eyers, D.M. and Bacon, J.M., An Event-Based Paradigm for
E-commerce Application Specication and Execution. Department of Operations
and Information Management, The Wharton School, University of Pennsylvania.
Bray, T., Paoli, J., Sperberg-McQueen, C.M. and Male, E. (1998) Extensible Markup
Language (XML) 1.0 (Second Edition), World Wide Web Consortium, 10 February.
Bray, T., Hollander, D. and Layman, A. (1999) Namespaces in XML, World Wide
Web Consortium, 14 January.
Catania, N., Web Services Events, Web Services Management Framework, Hewlett
Packard.
398
Language
Version
2.0
(see
OMG3 (2004) UML 2.0 Superstructure Specication. OMG Document ptc/04-1002 (see also http://www.omg.org/technology/documents/formal/uml.htm).
The Open Group (1991) Distributed Transaction Processing: The XA Specication.
Rogers, S. (2003) An Integrated Web Services Management Approach, IDC, July.
Sims, O. (2001) Making Components Work. Cutter Consortium, Executive Report
Vol. 4, No. 9.
Sims, O. (2002) A Component Architecture. Cutter Consortium, Executive Report
Vol. 5, No. 5.
Understand Enterprise Service Bus Scenarios and Solutions in Service-Oriented
Architecture, Part 1, IBM Developer Works.
Vambenepe, W., WSMF: Web Services Model, Web Services Management
Framework, Hewlett Packard.
Appendix C: References
399
Weblogic Server 7.0, Distributed Computing with BEA Weblogic Server, BEA
Systems.
Web Services RoadMap: Security in a Web Services World: A Proposed
Architecture and Roadmap, A Joint White Paper from IBM Corporation
and Microsoft Corporation April 7, 2002, Version 1.0, http://www106.ibm.com/developerworks/security/library/ws-secmap/
XUL (2004) The Open XUL Alliance, http://xul.sourceforge.net/links.html (see also
http://www.xulplanet.com/).
Web Sites
Agile
Alliance,
Agile
http://www.agilemanifesto.org
Manifesto
for
Software
Development,
400
various
pages:
http://www.c2.com/cgi/
Appendix C: References
401
Presentations
XML on Wall Street, February 2004, James McGovern and Jeff Ryan, Enterprise
SOA in Financial Services.
Tyndale-Biscoe, S., Sims, O., Sluman, C. and Wood, B. (2002) Business Modelling
for Component Systems with UML. Paper given at the EDOC 2002 Conference.
APPENDIX D:
ADDITIONAL READING
If someone is going down the wrong road, he doesnt need motivation to speed him up.
What he needs is education to turn him around.
Jim Rohn
The author team has composed a list of its favorite books that will further guide
you on the straight path of becoming a superior architect as we understand that
creating a service-oriented architecture requires many distinct disciplines in order to
be successful. The books listed below span multiple subject areas (in no particular
order) and will put you on the road leading to mastery of service-oriented architectures.
Java Web Services Architecture, James McGovern, Sameer Tyagi, Michael E. Stevens,
Sunil Mathew Morgan Kaufman, April 2003
False Prophets: The Gurus Who Created Modern Management and Why Their Ideas are
Bad for Business Today, James Hoopes, Perseus Publishing, April 2003
The Pragmatic Programmer: From Journeyman to Master, Andrew Hunt, David
Thomas, Ward Cunningham, Addison Wesley, October 1999
Agile Modeling: Effective Practices for Extreme Programming and the Unied Process,
Scott Ambler, Ron Jeffries, John Wiley & Sons, March 2002
e-Enterprise: Business Models, Architecture and Components, Faisal Hoque, Cambridge
University Press, April 2000
Software Architecture: Perspectives on an Emerging Discipline, Mary Shaw, David
Garlan, Prentice Hall, April 1996
403
404
Software Product Lines: Practices and Patterns, Paul Clements, Linda M. Northrop,
Addison Wesley, August 2001
Elements of UML Style, Scott Ambler, Cambridge University Press, December 2002
Whats the Big Idea? Creating and Capitalizing on the Best New Management Thinking,
Thomas Davenport, Laurence Prusak, H. Wilson, Harvard Business School Press,
April 2003
How to Open Locks with Improvised Tools, Hans Conkel, Harper Collins, October 1997
Zen and the Art of Motorcycle Maintenance, Robert Pirsig, Bantam Books, April 1984
The Mythical Man-Month: Essays on Software Engineering, Frederick P. Brooks,
Addison Wesley, August 1995
Data Access Patterns: Database Interactions in Object-Oriented Applications , Clifton
Nock, Addison Wesley, September 2003
Domain-Driven Design: Tackling Complexity in the Heart of Software, Eric Evans,
Addison Wesley, August 2003
Enterprise Integration Patterns: Designing, Building and Deploying Messaging Solutions,
Gregor Hohpe, Bobby Woolf, Addison Wesley, October 2003
Survival Is Not Enough: Why Smart Companies Abandon Worry and Embrace Change,
Seth Godin, Charles Darwin, Touchstone Books, December 2002
Smart Mobs: The Next Social Revolution, Howard Rheingold, Basic Books, October
2003
The Practical Guide to Enterprise Architecture, James McGovern, Scott W. Ambler,
Michael E. Stevens, James Linn, Vikas Sharan, Elias Jo, Prentice Hall, November
2003
APPENDIX E:
UPCOMING BOOKS
Leadership is not so much about technique and methods as it is about opening the heart.
Leadership is about inspiration of oneself and of others. Great leadership is about
human experiences, not processes. Leadership is not a formula or a program, it is a
human activity that comes from the heart and considers the hearts of others.
It is an attitude, not a routine.
Lance Secretan
Listed below are books that members of this author team are currently working on
and their anticipated release dates. We thank you for your continued support and
hope to serve you well in the future.
406
each of these activities will be explored along with practical considerations with a
focus on the issues, strategies and practices of enabling business agility.
In this book, readers will learn about:
IT Governance,
Portfolio Management,
Quality Assurance,
Software Risk Management,
Defect Management,
Agile COTS Assessment,
Architectural Assessment,
Process Patterns,
Agile Procurement Processes, and
Thought Leadership.
407
408