Developing Enterprise Web Services An Architects Guide Chatterjee Instant Download
Developing Enterprise Web Services An Architects Guide Chatterjee Instant Download
https://ebookbell.com/product/developing-enterprise-web-services-
an-architects-guide-chatterjee-22062124
Netbeans Ide Field Guide Developing Desktop Web Enterprise And Mobile
Applications 2nd Edition Patrick Keegan
https://ebookbell.com/product/netbeans-ide-field-guide-developing-
desktop-web-enterprise-and-mobile-applications-2nd-edition-patrick-
keegan-924580
Netbeans Ide Field Guide Developing Desktop Web Enterprise And Mobile
Applications Patrick Keegan
https://ebookbell.com/product/netbeans-ide-field-guide-developing-
desktop-web-enterprise-and-mobile-applications-patrick-keegan-978162
https://ebookbell.com/product/enterprise-application-development-
with-c-9-and-net-5-enhance-your-c-and-net-skills-by-mastering-the-
process-of-developing-professionalgrade-web-applications-1st-edition-
ravindra-akella-50860754
https://ebookbell.com/product/developing-enterprise-ios-applications-
iphone-and-ipad-apps-for-companies-and-organizations-james-
turner-2390338
Developing Enterprise Services For Sap Thomas Pohl
https://ebookbell.com/product/developing-enterprise-services-for-sap-
thomas-pohl-5411694
Developing Enterprise Java Applications With J2ee And Uml Khawar Zaman
Ahmed
https://ebookbell.com/product/developing-enterprise-java-applications-
with-j2ee-and-uml-khawar-zaman-ahmed-972532
https://ebookbell.com/product/developing-enterprise-chatbots-learning-
linguistic-structures-1st-ed-boris-galitsky-10484914
https://ebookbell.com/product/developing-enterprise-ios-applications-
james-turner-31831784
https://ebookbell.com/product/developing-enterprise-java-applications-
with-j2ee-and-uml-2004011-khawar-zaman-ahmed-cary-eumrysh-60052056
“With the publication of this book, the Web Services vision is about to
take a giant leap forward. Chatterjee and Webber, drawing on their own
impressive experiences building Web Services, painstakingly provide their
readers with concise, but thorough understandings of the most important
issues and their solutions. They unabashedly recommend best practices in
application architectures, put key technologies together and show their
readers how to step-by-step build world-class, enterprise Web Services
and ebusiness applications. It’s about time we had a book like this!”
—David Bunnell, former CEO & Editor of Upside Magazine,
and founder of PC Magazine, PC World, Macworld,
Publish, NewMedia, and BioWorld
www.hp.com/hpbooks
PEARSON EDUCATION
PRENTICE HALL PROFESSIONAL TECHNICAL REFERENCE
UPPER SADDLE RIVER, NJ 07458
WWW.PHPTR.COM
Library of Congress Cataloging-in-Publication Data
A CIP catalog record for this book can be obtained from the Library of Congress.
This material may be distributed only subject to the terms and conditions set forth in the Open
Publication License, v1.0 or later (the latest version is presently available at
<http://www.opencontent.org/openpub/>).
Prentice Hall books are widely used by corporations and government agencies for training, marketing,
and resale.
The publisher offers discounts on this book when ordered in bulk quantities. For more information,
contact Corporate Sales Department, Phone: 800-382-3419; FAX: 201-236-7141;
E-mail: [email protected]
Or write: Prentice Hall PTR, Corporate Sales Dept., One Lake Street, Upper Saddle River, NJ 07458.
Other product or company names mentioned herein are the trademarks or registered trademarks of their
respective owners.
ISBN 0-13-140160-2
Chapter 2
XML Fundamentals 17
XML: The Lingua Franca of Web Services 17
XML Documents 19
XML Namespaces 21
Explicit and Default Namespaces 23
Inheriting Namespaces 24
And Not Inheriting Namespaces 24
Attributes and Namespaces 25
XML Schema 26
XML Schema and Namespaces 27
vii
viii Contents
A First Schema 28
Implementing XML Schema Types 30
The any Element 44
Inheritance 48
Substitution Groups 50
Global and Local Type Declarations 52
Managing Schemas 54
Schemas and Instance Documents 58
XML Schema Best Practices 59
Processing XML 60
SAX: Simple API for XML 61
DOM: Document Object Model 64
Extensible Stylesheet Transformation (XSLT) and XML Path Language (XPATH) 66
Summary 68
Architect’s Note 68
Chapter 3
SOAP and WSDL 69
The SOAP Model 69
SOAP 73
SOAP Messages 74
SOAP Envelope 75
SOAP Header 75
SOAP Body 79
SOAP Faults 79
SOAP Encoding 83
SOAP RPC 85
Using Alternative SOAP Encodings 89
Document, RPC, Literal, Encoded 92
Document 92
RPC 92
Literal 93
Encoded 93
SOAP RPC and SOAP Document-Literal 93
SOAP, Web Services, and the REST Architecture 93
Looking Back to SOAP 1.1 95
Syntactic Differences between SOAP 1.2 and SOAP 1.1 96
Changes to SOAP-RPC 97
SOAP Encoding 97
Contents ix
WSDL 98
WSDL Structure 98
The Stock Quote WSDL Interface 100
Definitions 100
The Types Element 101
Bindings 104
Services 107
Managing WSDL Descriptions 108
Extending WSDL 110
Using SOAP and WSDL 111
Service Implementation and Deployment 112
Binding to and Invoking Web Services 113
Where’s the Hard Work? 117
Summary 118
Architect’s Note 118
Chapter 4
UDDI—Universal Description, Discovery, and
Integration 119
UDDI at a Glance 119
Analogies with Telephone Directories 120
The UDDI Business Registry 124
UDDI Under the Covers 127
The UDDI Specification 127
UDDI Core Data Structures 127
Accessing UDDI 130
How UDDI Is Playing Out 134
UDDI and Lifecycle Management 135
UDDI and Dynamic Access Point Management 137
Summary 139
Architect’s Note 140
x Contents
Chapter 5
Conversations 145
Conversations Overview 145
Conversational Requirements for B2B Interactions 147
Web Services Conversation Language 148
Consuming WSCL Interfaces 149
WSCL Interface Components 151
Interactions 151
Transitions 158
Conversations 162
The Bar Scenario Conversation 164
Relationship Between WSCL and WSDL 169
What WSCL Doesn’t Do 173
Summary 173
Architect’s Note 174
Chapter 6
Workflow 175
Business Process Management 175
Workflows and Workflow Management Systems 178
Workflows 178
Workflow Management Systems Drawbacks 180
Web Services and Workflow 181
Business Process Execution Language for Web Services (BPEL) 181
The BPEL Stack 182
Activities 183
Service Linking, Partners, and Service References 205
Message Properties and Property Aliases 209
Correlating Messages 210
Containers and Data Handling 218
Workflow Example: Online Shop 222
BPEL 1.1 and OASIS WSBPEL 246
BPEL and Its Relation to BPML, WSCI, WSFL, Xlang, and Others 246
Summary 247
Architect’s Note 248
Contents xi
Chapter 7
Transactions 249
ACID Transactions 249
Distributed Transactions and Two-Phase Commit 254
The Two-Phase Commit Approach 255
Dealing with Heuristic Outcomes 263
Advanced Topics: Nesting and Interposition 266
Scaling Transactions to Web Services 269
OASIS Business Transaction Protocol 271
The BTP Model 271
Implementing with BTP 276
Consuming Transactional Web Services 277
Client API 278
Under the Covers: BTP’s Two-Pipe Model 280
Transactionalizing Web Services 284
Supporting Infrastructure 286
Participants 287
Compensating Actions: A Strategy for Participant Implementation 290
Integrating Participants and Services 291
The Transaction Manager 293
Bringing It All Together: A Cohesive Example 294
BTP: In a Nutshell 297
Other Web Services Transaction Protocols 297
Microsoft .Net 297
J2EE and Enterprise Java Beans 299
WS-Coordination and WS-Transaction 300
Summary 303
Architect’s Note 303
Chapter 8
Security 305
Everyday Security Basics 306
Security Is An End-to-End Process 308
Data Handling and Forwarding 309
Data Storage 309
Errors in Identity 310
Web Service Security Issues 310
Data Protection and Encryption 311
xii Contents
Summary 429
Web Services Management 429
The Objectives of Web Services Management 430
Web Services Management Modules 431
Web Services Distributed Management 434
Summary 434
Architect’s Notes 435
Chapter 12
Real World Web Service Application Development—
Foundations 439
Enterprise Procurement 439
System Functionality and Architecture 441
Running the EPS Application 443
System Implementation 445
VendorAOrdering.java 446
VendorAProcurement.wsdl 449
EPS.html 452
EPSCatalog.html 453
ServiceServlet.java 453
Client-Side Binding Stubs 460
OutputServlet.java 461
Deploying the Application 462
Running the Application 465
Direct Web Service Invocations (without Binding Stubs) 469
Where Are the Holes? 471
Summary 471
Architect’s Notes 472
Chapter 13
Real World Web Service Application Development—
Advanced Technologies 473
Introduction 473
Building Evolvable and Composable Workflows 475
Automating the Procurement Process 476
Contents xv
Index 551
This page intentionally left blank
FOREWORD
K, Rome wasn’t built in a day, but once they got the sucker up and running, it was mag-
O nificent and, hey, it’s still there and functioning quite nicely. Having first heard about
Web services toward the end of the last century, I would have thought by now they would be
ubiquitous. At this point in time, I should be able to replace My Yahoo with a personalized Web
services portal uniquely suited to my quixotic needs and desires. Years ago, I started planning
this portal when I heard Bill Gates waxing poetically about Hurricane—a.k.a. “My Services”—
which was Microsoft’s vision of creating a suite of personalized Web services for early adopters
like me. Unfortunately, Microsoft abandoned this effort when critics complained it was really an
insidious plot to own people’s personal information.
Mostly by pure dumb luck, I’ve been at the forefront of technology for most of my life. As
a young man just out of college, I was working in Albuquerque, New Mexico, at a small com-
pany called MITS which, with a little help from a then 19-year old Bill Gates and his buddy Paul
Allen, started the personal computing revolution. Taking advantage of this happy situation, I
leveraged my background in media to launch a magazine called Personal Computing. These
experiences led me to found a number of other magazines including PC Magazine, PC World,
Macworld, Publish, NewMedia, and BioWorld. Most recently I was CEO and Editor of Upside
Media, Inc.
Throughout the years, I have been fortunate to have had a first-hand involvement in the
evolution of many revolutionary new innovations, including the first personal computer (Altair),
xvii
xviii Foreword
the first portal computer (Osborne), the first spreadsheet (VisiCalc), the Macintosh Computer,
Multi-Media, the Internet, and even Biotechnology.
To say that I have seen my share of “paradigm shifts” is an understatement. Technology
innovation has been all around me. Who would have thought that a couple of guys in a small
company in Albuquerque would start what would later become the PC revolution? Shouldn’t it
have come out of IBM or Xerox or some other big technology company? That’s exactly the rub.
Innovative ideas don’t always come from the big companies, sometimes they spring out from the
big guys and at other times they spring out from the little guys.
Based on all the above, I am completely convinced that Web services will level the playing
field between the little guy and the big guy as no technology has ever done before. Thanks to this
new revolution, the mom-and-pop company down the street can market their innovative software
and services to the neighborhood, to the global masses, as well as to the largest companies in the
world. But, we’re not only talking about the new and interesting. Even the most mundane and
boring is supported. The procurement system of the mom-and-pop company can seamlessly
interface with the billing system of a global multinational company and here’s where things get
really interesting. The systems of the multinational can also interface with the systems of the
mom-and-pop company. The most innovative new systems to the most boring, existing tasks are
all available on an anybody-to-anybody basis. This will ultimately happen but like many great
technologies, it will require a lot of work and patience before the dream is truly realized.
As Sandeep Chatterjee and James Webber so eloquently and clearly explain in this book,
real world Web services and Web services-based applications can’t simply be put together in a
haphazard manner by merely reading through one of the Web services technology specifications.
You need to be familiar with these standards and they are extremely important, but they only
represent the basic building blocks. To “architect” and construct world-class enterprise services,
developers need a much deeper knowledge of a number of different standards and tools plus
their “inter-relationships” and best practices for use.
Web services are small segments of larger applications and as such, quality-of-service
issues loom large if they are to be truly useful and scalable. When building them, you have to
factor in such considerations as: Availability (how often is the service available for consump-
tion); Accessibility (can it serve a client’s request now); Performance (how long does it take to
respond); Compliance (is it really “standard”); Security (is it safe to interact with this service);
Energy (suitable for mobile apps); and Reliability (how often does it fail). Like building Rome,
building Web services gets complicated fast.
So how do you architect an application to be reliable if some of the Web services you are
depending on become unavailable? Can an application be written to seamlessly scale to support
new Web services from an expanding group of strategic partners? What about transactional
guarantees or atomic coordination between multiple, independent services? And can you accom-
plish your design goal and still provide adequate safeguards for corporate and individual infor-
mation and intellectual property?
I imagine that the software world would have given up in disgust by now, moved on to some
new paradigm, except for two factors. The first is that all the major software companies are com-
xix
mitted to Web services to the tune of several billion dollars, and the second is that Web services
are, gosh darn-it, actually revolutionary. They are so revolutionary they represent a whole new
amazing way of doing business, which will transform the software industry forever and change
the very nature of the corporate IT department, thrusting it into the heart of strategic thinking.
Web services build on and extend the Web application model by allowing any client appli-
cation to access and use its capabilities. By implementing capabilities that are available to other
applications (or even other Web services) via industry standard network and application inter-
faces and protocols, Web services represent reusable software building blocks that are URL
addressable. We’re talking here about a concept called “anybody-to-anybody” communica-
tions—quoting from this book, “a person who implements a Web service can be almost one hun-
dred percent certain that anybody else can communicate with and use the service.”
Chatterjee and Webber aren’t so concerned, however, about Web services for the masses.
They tackle a much more difficult topic, which is Web services for enterprises. These are ser-
vices that have to be totally reliable, absolutely secure and extremely functional. Referring back
to the “building Rome” analogy, these guys aren’t really talking about building foot paths or
neighborhood streets, rather they are more interested in the avenues, aqueducts, and other major
arteries that seamlessly and safely interconnect the Porticus of Gaius to the Forum of Caesar—
the House of the Vestal Virgins to the Temple of Saturn, and back again. They are talking about
the communication and transportation systems that made Rome the most magnificent function-
ing city of the Ancient World.
In today’s global marketplace, world class enterprises need to interconnect with their cus-
tomers and partners internationally using legacy systems that are mostly incompatible with each
other, and they need to do this relatively fast and as inexpensive as possible. Web services pro-
vide the solution but not without overcoming some fairly difficult obstacles.
In the Web services world, nothing is as simple as it may seem. Take transactions, for
example. Transactions are the bedrock on which B2B interactions rise or fall, they are a funda-
mental abstraction or requirement for what we sometimes refer to as “fault-tolerant computing.”
In a lucid and detailed style, the authors point out that the choices for transactions are scarce
and, in fact, the OASIS Business Transaction Protocol (or simply BTP) is the “only Web ser-
vices transaction protocol with implementation we can use today.” They explain BTP and how to
implement it, but just in case you get in over your head, they also suggest that unless you have
specialist knowledge in this area, you should give “serious consideration” to buying or outsourc-
ing it.
As with transactions, this book goes into great detail to describe the Web services technol-
ogies and standards that can be used in the real world today. These address the most challenging
enterprise requirements including conversations, workflow, security, the challenges inherent in
the development of mobile systems, how to build user-facing portals by aggregating back-end
Web services, and how to manage an ever growing number and type of Web services within the
enterprise. But more than this, the authors tell you in a concluding section filled with source
code and a step-by-step guide how to put this together. You’ll learn how to actually develop a
xx Foreword
Web service application and deploy it onto the Tomcat application server and the Axis SOAP
server (both freely available).
The ambitious goal of Developing Enterprise Web Services: An Architect’s Guide is to
give readers a “thorough understanding” of the steps necessary to build and deploy Web services
and client applications that meet enterprise requirements. This is a lofty goal indeed, and you’ll
want to spend some serious time going through all the clear and concise content that the authors
have spent well over a year developing. I found it really amazing.
Fortunately, with the publication of this book, the Web services vision is about to take a
giant leap forward. We are building our “Rome” and the end is finally in sight. Chatterjee and
Webber, drawing on their own impressive experiences building Web services, painstakingly pro-
vide their readers with concise, yet thorough understanding of the most important issues and
their solutions. They unabashedly recommend best practices in application architectures, put key
technologies together and show their readers step-by-step how to build world-class, enterprise
Web services-based e-business applications. And darn it, it’s about time we had a book like this!
David Bunnell
Berkeley, California
September 2003
ACKNOWLEDGMENTS
The authors would like to thank the many people who have helped and contributed to this
book. First, we would like to thank Bob Bickel for supporting and sanctioning our writing of this
book. We would also like to thank the following people who reviewed early drafts of the manu-
script and provided insightful feedback: Tony Wasserman, Lionel Lavallee, Sriram Somanchi,
Ravi Trivedi, Mark Little, Stuart Wheater, Andy Taylor, Savas Parastatidis, Lindsay Marshall,
Scott Williams, Satish Thatte, and Farhat Kaleem.
We would also like to thank the people at Pearson Education and, in particular, our execu-
tive editor, Jill Harry, who supported, encouraged, and guided us throughout the process. And, of
course, our most profound thanks go to our families for their constant love and encouragement.
Jim would especially like to thank Katherine Neasham for her continued support.
To all of these and many others too numerous to mention, we give our heartfelt thanks and
appreciation.
xxi
This page intentionally left blank
C H A P T E R 1
Introduction
eb services technologies are fundamentally changing the software industry, making the
W role of enterprise IT organizations more strategic, and recasting the software vendor-
consumer relationship. Web services are also being hailed by CEOs, CIOs, and CTOs as the
next-generation vehicle for driving topline growth and controlling bottom lines. But, simply
jumping on the Web services bandwagon won’t lead to corporate success. Web services are sim-
ply a platform; how companies implement a solution using this new technology determines their
success and ultimately their return on investment (ROI). In this book, we take a no-nonsense,
strategic view of developing enterprise Web services and applications: looking at where the
technologies are, where they are going and how companies need to architect their own Web ser-
vices solutions to not get left behind.
Web services platforms provide the functionality to build and interact with distributed
applications by sending eXtensible Markup Language (XML) messages. Additional technology
layers are constantly emerging, others are being refined, and still others are being discarded. The
platform is essentially a moving target.
To stay on the leading edge, companies are building and deploying their applications
while work on the underlying platform continues. And, as with any industry standard initia-
tives which require building consensus, the Web services platform will remain a work in
progress for some time.
How can you build any meaningful application, let alone mission-critical enterprise applica-
tions, on such a platform? If you are a developer or an architect charged with building Web ser-
vices or applications that consume Web services, you have to know where the platform is today,
and where it is going. Otherwise, the endless pit of application rewrite and maintenance overhead
will far outweigh any benefits that can be garnered from this promising new technology.
1
2 Chapter 1 • Introduction
Real world, enterprise Web services and applications cannot be developed by simply reading
through the Simple Object Access Protocol (SOAP) or the Web Services Description Language
(WSDL) specifications. Developers must understand a number of different standards and technolo-
gies, and more importantly, their inter-relationships as well as best practices for their use.
Consider an e-business application that requires interaction between multiple partner Web
services. Understanding SOAP and WSDL gives developers the ability to write Web services
and consume them within their application. But, how must the application be architected to be
reliable in case some Web services become unavailable? How can an application be written to
seamlessly scale and support new Web services from a growing list of strategic partner compa-
nies? What are the best practices for developing mobile Web service applications, and how can
individual Web services be created to support quality-of-service (QoS)? How can transactional
guarantees or atomic coordination between multiple, independent Web services be supported by
applications? And, how can all of this be done securely so that corporate and individual informa-
tion and intellectual property are safeguarded?
In this book, we focus on how to develop Web services and applications within real world
enterprise environments. We describe not only the vanilla Web services platform consisting of
SOAP, WSDL, and UDDI (Universal Description, Discovery and Integration), but also build on
this to include the other technologies, standards, and emerging standards that provide support for
transactions, security and authentication, mobile and wireless, quality-of-service, conversations,
workflow, interactive applications and portals, as well as systems management.
We discuss the opportunities represented by Web services and, more importantly, describe
best practices and architectural patterns for building enterprise systems that position you and
your organization to most fully leverage those opportunities. We do not summarize any one Web
services standard, but instead provide a sufficiently thorough discussion of all of the critical
technologies and standards, as well as their inter-relationships, that are necessary for building
enterprise Web services and applications. Our focus is on developing enterprise Web services
and applications based on industry standard Web services technologies, not on summarizing
standards.
Let’s get started by reviewing what Web services are and why they are important.
Figure 1-1 The architectural differences between (a) a monolithic application with integrated
capabilities, and (b) a distributed application using Web services-based capabilities.
The capabilities provided by a Web service can fall into a variety of categories, including:
• Functions, such as a routine for calculating the integral square root of a number.
• Data, such as fetching the quantity of a particular widget a vendor has on hand.
• Business processes, such as accepting an order for a widget, shipping the desired
quantity of widgets and sending an invoice.
Some of these capabilities are difficult or impractical to integrate within third-party applications.
When these capabilities are exposed as Web services, they can be loosely coupled together,
thereby achieving the benefits of integration without incurring the difficulties thereof.
Web services expose their capabilities to client applications, not their implementations.
This allows Web services to be implemented in any language and on any platform and still be
compatible with all client applications.
4 Chapter 1 • Introduction
Each building block (Web service) is self-contained. It describes its own capabilities, pub-
lishes its own programmatic interface and implements its own functionality that is available as a
hosted service. The business logic of the Web service runs on a remote machine that is accessi-
ble by other applications through a network. The client application simply invokes the function-
ality of a Web service by sending it messages, receives return messages from the Web service
and then uses the results within the application. Since there is no need to integrate the Web ser-
vice within the client application into a single monolithic block, development and testing times,
maintenance costs, and overall errors are thereby reduced.
Assume you want to build a simple calculator application that determines the appreciation
in stock price for any company given its corporate name and the date the stock was originally
purchased. The application must do the following:
• Determine the stock ticker symbol for the company based on the company name.
• Determine the latest price of the stock based on the ticker symbol.
• Determine the historical price of the stock for the given date based on the ticker
symbol.
• Calculate the difference between the two stock prices and present it to the user.
This seemingly trivial application is in fact enormously complex. Right from the get go
there are problems. We have to build a database with the names of all the companies in the coun-
try and their associated stock ticker symbol. More importantly, we must maintain this database
as companies are newly listed, become delisted, change their names or their ticker symbol, or
merge. To access the real-time price of a stock, we must have a relationship with a financial or
brokerage firm. The legal complexities and hassles in architecting such a relationship is bad
enough, not to mention the IT infrastructure that must also be put into place.
Unless you work for a brokerage firm or are in the business of maintaining stock informa-
tion, the time and costs necessary to build the infrastructure necessary to support the stock
appreciation calculator are enormous and, in most cases, prohibitively so. Until a brokerage firm
itself decided to provide such a calculator, customers would have to make do without it.
Web services simplify and in many ways eliminate the need to build for yourself the sup-
port infrastructure—both legal and technical. The calculator can be developed by simply passing
messages between the calculator application and the appropriate set of Web services. Figure 1-2
graphically depicts the flow of messages, and the fundamental architecture of a Web services-
based stock price appreciation calculator.
Messages are sent between the calculator application and the following three Web services:
Figure 1-2 Sending and receiving Web service messages to build a stock price appreciation
calculator.
Since each of these three Web services is provided, hosted, and managed by another com-
pany, the developer of the calculator application has only to focus on his key insight or contribu-
tion alone. Complex, domain-specific issues such as the fact that Hewlett-Packard’s ticker tape
symbol was HWP and only recently became HPQ are (or should be) handled by the Web ser-
vices directly. Using these three Web services, the application can easily determine the stock
price appreciation for Hewlett-Packard from August 15, 2002, to be $17.51 - $15.00 = $2.51.
Based on the data from the Web services, the calculator application can provide further analysis,
such as the percentage appreciation, and present all of the information in an easy-to-understand,
graphical manner.
Assuming the required capabilities exist and are available as Web services, developers can
focus on their unique value-added piece and utilize third-party Web services for the remainder of
the functionality. The benefits of using Web services are clear:
• Integrate both data and business processes with market constituents and business
partners that have desired domain expertise or capabilities.
• Reduce or eliminate many errors born out of complex and large monolithic
applications.
• Simplify application maintenance and customization by segmenting an application into
the client application and each of its consumed Web services.
• Significantly reduce time-to-market.
As we take this idea further, and more and more companies expose some of their internal
capabilities as Web services, the real value of Web services lies in the composition of a set of
Web services. Consider the following two companies. One is a traffic service company that mon-
itors automobile traffic on major roads and highways and predicts expected travel times. The
second is a taxi reservation service company that allows customers to reserve taxis for pickup at
a specified location and time. Each of these companies and their products are compelling in and
of themselves. However, if these companies exposed their capabilities as Web services, these
services can be composed together into a single, more compelling and useful service—either by
one of these two companies themselves or by a third company.
As an example, consider taking a taxi to the airport before catching a flight for a meeting.
By leveraging the capabilities of both companies through their respective Web services, a trav-
eler can reserve a taxi and rest assured that if an accident or other traffic conditions cause an
unexpected increase in her travel time, the taxi reservation can be held and an alert sent to the
traveler advising her of the updated taxi schedule as well as the traffic situation that caused the
change. By simply and intelligently combining the individual services of the two companies, we
are able to create a more compelling and useful service for travelers. The composition of Web
services from different enterprises is depicted in Figure 1-3. The technologies that form the
foundations of Web services are SOAP, WSDL, and UDDI.
SOAP
Simple Object Access Protocol (SOAP) is an XML-based mechanism for exchanging informa-
tion between applications within a distributed environment. This information exchange mecha-
nism can be used to send messages between applications and, more specifically, can be used to
implement remote procedure calls (RPCs). RPCs allow one application to invoke and use a pro-
cedure (or capability) of another, possibly remote, application.
SOAP does not specify any application implementation or programming model. Instead, it
provides a mechanism for expressing application semantics that can be understood by applica-
tions no matter how they are implemented. Accordingly, SOAP is application language- and
platform-independent. SOAP is typically used in conjunction with HTTP, which supports easy
traversal of firewalls and is sufficiently lightweight to be used within mobile and wireless envi-
ronments.
What Are Web Services? 7
Figure 1-3 Composing together services exposed by multiple corporations to create a separate
service offering.
WSDL
Web Services Description Language (WSDL) is an XML-based language for describing Web
services. Through a WSDL description, a client application can determine the location of the
remote Web service, the functions it implements, as well as how to access and use each function.
After parsing a WSDL description, a client application can appropriately format a SOAP request
and dispatch it to the location of the Web service.
WSDL descriptions go hand-in-hand with the development of a new Web service and are
created by the producer of the service. WSDL files (or pointers thereto) are typically stored in
registries that can be searched by potential users to locate Web service implementations of
desired capabilities.
UDDI
Universal Description, Discovery, and Integration (UDDI) is a specification for a registry of
information for Web services. UDDI defines a means to publish and, more importantly, discover
(or search for) information about Web services, including WSDL files.
8 Chapter 1 • Introduction
After browsing through an UDDI registry for information about available Web services,
the WSDL for the selected service can be parsed, and an appropriate SOAP message can be sent
to the service. Figure 1-4 graphically illustrates the relationships between SOAP, WSDL, and
UDDI.
Now that we have a glimpse into what Web services are and how they can be used to build
interesting applications and systems, we next discuss why this new technology is important.
as HTTP and HTML were used to bridge this gap between Web application clients and the Web
applications themselves. Application servers and other middleware emerged to reduce the com-
plexities of building Web apps while still allowing pervasive access to each Web application.
Web services build on and extend the Web application model. Web applications allow any
Web browser to access its functionality, with the application user interface presented through the
browser. Web services take this a step further and allow any client application to access and use
its capabilities.
A Web application allows universal user access to its capabilities by supporting industry
standard interfaces to its user interface. They do not allow extending or adding to their capabili-
ties through programmatic access. To leverage the functionality of a Web application and build
on it, complex and often unreliable techniques, such as screen scraping, must be used. Web ser-
vices address this issue by allowing programmatic access to the Web services’ capabilities using
industry standard interfaces and protocols. The evolution of Web applications to Web services is
shown in Figure 1-5.
Figure 1-5 Evolution of Web applications to Web services and key architectural differences.
10 Chapter 1 • Introduction
Applications that are exposed as Web services have a large base of other applications (that
are also exposed as Web services) with which to communicate. Since they are based on simple
and open industry standards (or de facto standards), Web services make significant inroads
toward ubiquitous interoperability. Interoperability here is on the scale of the Web or the Inter-
net, not just a group or organization.
Based on industry standards and supporting anybody-to-anybody interoperability, Web
services are poised to be the platform that delivers on the needs of e-businesses. All companies
interact with other companies in the course of conducting their businesses. Manufacturing com-
panies interact with component suppliers, distributors interact with manufacturing companies,
retailers interact with distributors, and so on. Initially, these interactions were manual, conducted
by mail, phone, and fax.
Web applications allowed companies to interact with one another by exposing some of
their capabilities and business processes to others on the Web. But, most of the time, this still
required a human being interacting with the Web application on the other side. Web services
remove the need for constant human intervention while companies interact by enabling pro-
grammatic conversations between applications.
By removing this barrier to e-business interactions, Web services enable new business
relationships as well as more fluid relationships that can be configured and reconfigured on-the-
fly. Although Web services offer numerous benefits, they also present many challenges and risks
within traditional enterprise environments. We discuss Web services and how they fit within
enterprises next.
plify integration, reducing time-to-market and costs, as well as support operational efficiencies
that streamline the bottom line.
The potential benefits of Web services are enormous. The risks are equally great, if not
greater. Enterprise IT organizations will find themselves in the middle, responsible for reconcil-
ing the benefits with the risks of adopting Web services within the enterprise.
IT organizations, in an effort to gain a controlling foothold over risky and potentially
harmful Web services traffic, will insist on controlling which Web services applications interact
with one another. A misbehaving Web service will simply be cut off from interacting with any
enterprise applications; such cut offs may even be preemptive if there is a history of problems or
a perception of a threat.
To accomplish this, IT will take on a more strategic role within organizations and align
itself more closely with individual business units. Critical decisions by business units, such as
the partners from which to source components, will have to be cleared by IT if those partners’
Web services will interact with the applications or Web services of the company.
This will have major ramifications for enterprise application architectures. Enterprise
applications will support dynamic and swappable Web services—hardwired Web service invoca-
tions will no longer suffice. Moreover, IT will use management environments to deploy enter-
prise-wide policies for Web services that will monitor and strictly enforce the Web services that
applications can use.
There is no doubt that the uptake of Web services within the enterprise will require
changes. Many of these changes will be to established procedures and existing policies that have
been supported by years of experience and billions of dollars. Nonetheless, the potential bene-
fits—both financial and strategic—to adopting Web services are sufficiently large to justify such
changes.
Moving Forward
As organizations transition from researching Web services technologies and building internal
prototypes to early-adopter deployments, and then eventually to mainstream adoption of Web
services, the key differentiator and requirement is that these applications and systems are appro-
priate for “real world” deployment and usage. Some of the early prototypes built using Web ser-
vices were in many ways toys. All of the Web services and client applications run on a single
machine, hosted by the same application server, in a fully controlled environment. Many of these
services and applications that once worked as prototype systems will no doubt break—some
immediately, while others may take more time to break (which is much worse).
The next few years will see Web services and applications become hardened and ready for
“real world” deployment. The real world is indeed a cold and hard place. Web services run
remotely, sometimes go down and become unavailable, evolve into multiple versions, as well as
encounter variances in network bandwidth and quality. Moreover, politics and competitive
Summary 13
issues between organizations will result in unexpected outages and behaviors along critical
dependencies within applications.
Already we see many standards bodies that have been convened to address these and other
issues. Some of the technologies that are being developed to address these needs will eventually
be automatic, transparent to developers as existing infrastructure and tools, such as middleware
and IDEs, and incorporate the technologies. Nonetheless, architects and developers will need to
have a keen understanding of these issues and technologies to develop enterprise-class Web ser-
vices and applications.
In this book, we look at the Web services platform—where it is now and where it is
going—with an eye toward developing robust enterprise Web services and applications. In the
first of the three sections of this book, we begin by describing the core technologies that make up
the Web services platform. These are XML, SOAP, WSDL, and UDDI. This platform provides a
distributed computing environment based on standard interfaces and protocols, but it does not
implement all of the capabilities necessary for implementing enterprise systems.
In the second part of this book, we look at some of the standards and emerging technolo-
gies that, once layered on top of the vanilla Web services platform, address some of the critical
requirements of enterprise systems. These technologies include support for transactions, security
and authentication, conversations, workflow, quality of service, mobile and wireless, services
and systems management, as well as interactive applications and Web portals.
In the third part of the book, with both the vanilla Web services platform as well as some
of the critical advanced technologies and standards under our belt, we take an in-depth look and
provide step-by-step instructions for building an enterprise application using Web services.
Addressing one of the biggest pain points in business processes today, we develop an enterprise
procurement application that ties together the inventory and ordering Web services of multiple
suppliers and facilitates the procurement process. We first develop the entire application using
only the vanilla Web services platform (as described in the first part of the book). After identify-
ing the shortcomings of this implementation based only on the vanilla platform, we add to and
expand on the application using the advanced standards and technologies described in the sec-
ond part of the book.
We conclude this book by summarizing and highlighting some of the key points to remem-
ber when developing enterprise Web services and applications.
Summary
Web services represent enormous opportunities and challenges. How organizations negotiate
these hurdles will determine the benefits they incur. In this book, we describe the Web services
platform—where it is and where it is going—so that developers building applications are cogni-
zant of the fluid nature of the platform and can address enterprise system requirements within
the context of a changing platform.
14 Chapter 1 • Introduction
Architect’s Note
• Web services are remotely hosted and managed applications whose capabilities can be
accessed programmatically by client applications via an addressable URL.
• The core Web services platform, consisting of SOAP, WSDL, and UDDI, provides the
means for building distributed applications based on industry standard technologies,
interfaces, and protocols.
• The core Web services platform does not provide all of the necessary capabilities on
which to build enterprise systems. Additional technologies are being developed and are
being standardized that can be layered on top of the core platform and provide support
for security and authentication, transactions, mobile and wireless access, quality-of-
service, workflows, conversations, systems and service management, as well as
interactive applications and Web portals.
• Web services are important and different from other distributed computing
environments because they are based on industry standards that are nearly ubiquitous.
This allows unprecedented interoperability between applications as well as companies
and supports anybody-to-anybody applications.
• The adoption of Web services within enterprises will require fundamental changes to
IT organizations that are responsible for deploying and maintaining enterprise systems.
In an effort to maintain control over enterprise systems within a Web services
environment, IT will take on a more strategic role that is aligned with individual
business units and become part of the business decision process.
P A R T
1
n this first section of the book, we briefly review the industry standards, technologies and
I concepts that underlie Web services. These critical technologies support the development of
Web services as well as applications that use (or consume) Web services. But, be forewarned
that these foundational technologies do not provide everything necessary to build Web services
and applications that meet enterprise requirements. We cover these advanced technologies in
Section Two of this book.
In this section, we describe the following technologies that together make up the basic
Web services platform:
Chapter 2: XML Fundamentals. In this first of three chapters in Part One, we start with
a discussion of the fundamentals of the eXtensible Markup Language (XML), the basic technol-
ogy on which Web services are based. From network protocols up the stack to back-end data-
bases, XML in all its forms has had a commoditizing effect on enterprise computing systems
and being both platform and language independent is a natural choice for the level of interopera-
bility required of Web services.
Chapter 3: SOAP and WSDL. Here we describe in detail the two technologies that
make up the foundations of Web services: SOAP and WSDL. SOAP (Simple Object Access
Protocol) is an XML-based mechanism for exchanging information between applications
within a distributed environment. This information exchange mechanism can be used to send
messages between applications and, more specifically, can be used to implement remote pro-
cedure calls (RPCs). WSDL (Web Services Description Language) is an XML-based language
for describing Web services. Through a WSDL description, a client application can determine
15
16 Part 1 • Basic Web Services Standards, Technologies, and Concepts
the location of the remote Web service, the functions it implements, as well as how to access
and use each function.
Chapter 4: UDDI. In this chapter, we describe UDDI (Universal Description, Discovery,
and Integration), which is a specification for a registry of information for Web services. UDDI
defines a means to publish and, more importantly, discover (or search for) information, includ-
ing WSDL files, about Web services. We also describe the UBR (UDDI Business Registry),
which is a global implementation of the UDDI specification.
After reading Section One, you will have a strong understanding of the technologies, stan-
dards and concepts underlying Web services. Refer to Section Three for a detailed, step-by-step
guide and lots of sample source code to actually develop Web services and client applications.
C H A P T E R 2
XML Fundamentals
he suite of technologies grouped under the XML umbrella provides the fundamental
T building blocks of the Web services architecture. From network protocols through back
end databases, XML has had an advantageous effect on enterprise computing systems. Being
platform and language independent is a natural choice for building interoperable systems via
Web services. Given the importance of XML in enterprise computing, and specifically in Web
services, this chapter recaps the fundamentals of XML before embarking on a discussion of
more advanced topics such as namespaces and XML Schema.
17
18 Chapter 2 • XML Fundamentals
with the same name, care must be taken when combining those formats. To eliminate
name confusion when combining formats, XML provides a namespace mechanism that
is supported in all XML-based technologies.
• XML is License-Free, Platform-Independent, and Well-Supported
By choosing XML as the basis for Web services, we gain access to a large and growing
community of tools and techniques on which to develop value. Basing Web services on
XML is similar to basing a database strategy on SQL—you still have to build your own
database, programs, and procedures that manipulate it, but there are many tools and
commodity components available to help. Furthermore, since XML is license-free,
Web services can be built without incurring royalty payments.
While a full discussion of the subject of XML is beyond the scope of this book, before delving
deeply into developing Web services it is imperative that at least the basics of XML and XML
processing are understood. Although some of the XML detail inherent in developing Web ser-
vices can be abstracted by toolkits, the increasing popularity of XML at the application level
means that any learning at this point will, in addition to accelerating the rate of understanding
Web services technology, be generally valuable in day-to-day development. That said, it’s time
to get acquainted with some fundamental XML concepts.
XML Documents
The purpose of an XML document is to capture structured data, just like an object in an object-
oriented programming language. Documents are structured into a number of elements, delimited
by tags which may or may not be nested within other elements.
Anyone familiar with the syntax of HTML will immediately be comfortable with the look
and feel of XML, although anyone thinking about coding XML like HTML must be wary—
XML is extremely strict in its syntax, where the interpretation of HTML (particularly by brows-
ers) is quite permissive. As we progress through the examples, it is worth remembering the fun-
damental document syntax:
1. All tags must have corresponding end tags unless they are devoid of subelements, in
which case they can be represented as
<element-name … attributes … />.
2. No element can overlap any other element, although nesting within elements is
allowed.
3. A document can only have a single root element (which excludes the XML declaration
<?xml … ?>).
4. Attributes of an element must have unique names within the scope of a single tag.
5. Only element names and attribute name-value pairs may be placed within a tag declara-
tion.
20 Chapter 2 • XML Fundamentals
The best way to understand XML is by example, and the XML document shown in Figure
2-1 is typical of the structure of most XML documents, though it is somewhat shorter than most
we’ll be seeing in the Web services world.
Figure 2-1 shows a simple XML document that contains data about a DVD. The document
(as all XML documents should) begins with the XML Declaration, delimited by <? and ?>.
This declaration provides information for any programs that are going to process the document.
In this case it informs any processors that the XML document is encoded according to version
1.0 (at the moment 1.0 is the first and only XML version and the 1.1 effort is underway) and the
underlying textual encoding is UTF-8 as opposed to ASCII.
The remainder of the document is where the actual structured data is held. In this case we
have a root element delimited by the dvd tag, which contains two subelements delimited by
the title and year tags. Those subelements contain textual data that we assume relates to the
name of the film on the disk and the year of its release (though this is a convention and we could
name elements badly, just as we can poorly name variables when programming).
We can take this document one stage further and make it a little more useful for those pro-
grams who might want to derive richer information from it. The document shown in Figure 2-2
embellishes that from Figure 2-1 adding in the DVD regional information as an attribute to the
root element region="2". We have also added a comment to aid human readability that is
delimited by <!-- and -->.
The addition of the attribute in Figure 2-2 would, for instance, be of great help to a DVD
cataloging system that could use the region attribute to classify disks by their target geographical
region.
XML Namespaces 21
XML Namespaces
Namespaces in object-oriented programming languages allow developers to name classes unam-
biguously. Given that different organizations (should) use different namespaces for the software
components, even in the cases where two third-party software components contain a class with
exactly the same name, the fact that those classes are in different namespaces means that they
are easily distinguished from one another.
Unambiguous naming is a requirement that also permeates the XML world. For example,
it may be the case that several versions of a document with a root element dvd may exist, but the
structure of each is different. The way we distinguish the document that we want from a number
of available dvd documents is by its XML namespace.
Unlike popular programming languages where specific scope resolution operators are used
to build namespaces (e.g., MyPackage.MyClass in Java and MyNamespace::MyClass in
C++) the convention in XML is to use a URI (Universal Resource Identifier) as the namespace
identifier.
The URI is the union of the familiar URL and the not-so-familiar URN (Uniform
Resource Name) schemes as shown in Figure 2-3 and Figure 2-4.
ftp://src.doc.ic.ac.uk
gopher://gopher.dna.affrc.go.jp
http://www.arjuna.com
mailto:[email protected]
news:uk.jobs.offered
telnet://foo.bar.com/
search/suncom/?qt=java). Depending on the scheme in use, not all of these parts are neces-
sary but given those rules any valid URI can be constructed.
urn:oasis:names:tc:BTP:1.0:core
urn:oasis:names:tc:BTP:1.0:qualifiers
XML namespaces affiliate the elements and attributes of an XML document with
namespaces identified by URIs. This process is called qualification and the names of the ele-
ments and attributes given a namespace scope are called qualified names, or simply QNames.
Now that we understand we can qualify our documents with a namespace, we can extend
the example in Figure 2-2 to include namespace affiliation. Given that it is likely there will be
other DVD cataloging systems and those systems will also use elements with names like dvd
(which will likely have a different structure and content from our own version), the addition of a
namespace into our XML document confers the advantage that it cannot be mixed up with any
other similar-looking dvd documents from outside of our namespace. Our newly namespaced
document is shown in Figure 2-5.
Figure 2-5 A simple namespaced XML document with attributes and comments.
We have introduced into Figure 2-5 an association between a prefix and a URI (in this case
we’ve used a URL), using the xmlns attribute from the XML Namespace specification. We
XML Namespaces 23
then used that prefix throughout the document to associate our elements with that namespace.
Any XML processing infrastructure that reads our document does not see the elements as simply
their element names but de-references the URI to arrive at the form {URI}:<local name>
(e.g., {http://dvd.example.com}:dvd}) which is unambiguous, unlike the element
name alone (i.e., just dvd). It is important to remember that the syntax {prefix}:<local
name> is not understood by XML processing programs, it is a convention used when describing
qualified elements.
We present a modified version of the XML from Figure 2-5 in Figure 2-6, where the
default namespace declaration implicitly scopes all following elements within the http://
dvd.example.com namespace, like this:
Inheriting Namespaces
Once a default or explicit namespace has been declared, it is “in scope” for all child elements of
the element where it was declared. The default namespace is therefore propagated to all child
elements implicitly unless they have their own explicit namespace.
The rule of thumb for choosing a default or explicit namespace is that if you can’t see at a
glance yourself which namespace an element belongs to, then no one else will be able to and,
therefore, explicit namespaces should be used. If, however, it is obvious which namespace an
element belongs to and there are lots of such elements in the same namespace, then readability
may be improved with the addition of a default namespace.
It is important to realize that any children of the genre element in Figure 2-7 that use the
default namespace will be using the default namespace of the dvd element since the genre ele-
ment only declares an explicit namespace for its scope. Similarly, with default namespaces, any
element is at liberty to define a namespace for itself and any of its children irrespective of the
namespace affiliations of any of its parent elements. This is shown below in Figure 2-8:
The genre element from Figure 2-8 declares that the default namespace for itself and its chil-
dren (if any) are, by default, in the namespace http://film-genre.example.com. This
differs from the example shown in Figure 2-7 since in the absence of any explicit namespace,
children of the genre element belong to the http://film-genre.example.com and not
to the http://dvd.example.com namespace as the outer elements do.
Of course it may be the case that an element does not require a default namespace and that
the parent default namespace is inappropriate. In such cases, we can remove any default
namespace completely, by setting it to the empty string xmlns="".
At this point we now understand both basic XML document structure and some more
advanced features like namespaces. These both set the scene for higher-level XML-based tech-
nologies (including Web services) which we shall continue by looking at XML Schema.
XML Schema
With the exception of the basic XML syntax, XML Schema is without a doubt the single most
important technology in the XML family. In the Web services world, XML Schema is the key
technology for enabling interoperation.
XML Schema is a W3C recommendation3 that provides a type system for XML-based
computing systems. XML Schema is an XML-based language that provides a platform-indepen-
dent system for describing types and interrelations between those types. Another aspect of XML
Schema is to provide structuring for XML documents.
In fact, the analogy between XML technologies and object-orientation is clear if we com-
pare XML documents to objects and XML Schema types to classes. XML documents that con-
form to a schema are known as instance documents, in the same way that objects of a particular
class are known as instances. Thus we can conceptually match XML Schema schemas with
classes and XML documents with objects, as shown in Figure 2-9.
The conceptual relationship between an object model and XML Schema is straightforward
to comprehend. Where object-based systems classes and their interrelationships provide the
blueprint for the creation and manipulation of objects, in the XML arena it is the type model
expressed in XML Schema schemas that constrain documents that confirm to those schemas.
Like object-oriented programming languages, XML Schema provides a number of built-in
types and allows these to be extended in a variety of ways to build abstractions appropriate for
particular problem domains. Each XML Schema type is represented as the set of (textual) values
that instances of that type can take. For instance the boolean type is allowed to take values of
only true and false, while the short type is allowed to take any value from -32768 to
32767 inclusively. In fact, XML Schema provides 44 different built-in types specified in the
http://www.w3.org/2001/XMLSchema namespace. Additionally, XML Schema allows users to
develop their own types, extending and manipulating types to create content models is the very
heart of XML Schema.
CHAPTER I
The purpose of the First Part of this study was to show that with the
knowledge of the Secret of Charlotte Brontë, brought to us by Dr. Paul
Heger's generous gift of these pathetic and beautiful Love-letters, the
'Problem of Charlotte Brontë,' as so many very clever but inattentive
psychological critics have stated it, has lost all claim to serious
attention.
The basis of the 'Problem' was the alleged 'dissonance' between
Charlotte's personality and her genius—between her dreary, desolate,
dull, well-tamed existence, uncoloured, untroubled by romance (as
Mrs. Gaskell painted it), and the passionate atmosphere of her novels,
where all events and personages are seen through the medium of one
sentiment—tragical romantic love.
We now know that the dissonance did not exist; that from her twenty-
sixth year downwards, Charlotte's life was, not only coloured, but
governed by a tragical romantic love: that, in its first stage, threw her
into a hopeless conflict against the force of things and broke her
heart: but that, because the battle was fought in the force, and in the
cause, of noble emotions, saved her soul alive; and called her genius
forth to life: so that it rose as an immortal spirit from the grave of
personal hopes.
Understanding this, we know that there is no 'Problem' of Charlotte
Brontë: but that her personality and her genius and her life and her
books were all those of a Romantic. But although there is no
psychological Problem, a difficulty that concerns the historical criticism
of Charlotte's life and her books does remain. And this difficulty has to
be faced and conquered, not by speculations nor arguments, but by
methods of enquiry.
When we study Charlotte Brontë's masterpiece Villette in comparison
with what we now know about the romance in her own life, we
recognise two facts: the first is that, in this work especially, she has
painted with such power the emotions she has undergone that her
words become feelings that lift and ennoble the reader's sensibility:
and thus serve him—in the way that it belongs to Romantics to serve
mankind.
But the second fact we discover is that,—again, in this book
particularly,—historical personages and real events are used as the
materials for an imaginary story, in a way that has produced critical
confusion: and what is graver still—has caused false and injurious
opinions to be formed about historical people. And the difficulty we
have to face is, not what amount of blame belongs to Charlotte for
misrepresenting historical facts, nor even need we ask ourselves what
reason she had for thus misrepresenting them. Because the reason
becomes plain when we take the trouble to realise that the motive the
writer of this work of genius had in view was one that concerned her
own personal liberation from haunting memories, rather than any
motive concerning the impressions she might produce.
There can be no doubt that Charlotte's motive in Villette, judged as a
method of personal salvation, was not only a permissible, but a noble
one. It is the one that Pater attributed to Michael Angelo: 'the effort
of a strong nature to attune itself to tranquillise vehement emotions
by withdrawing them into the region of ideal sentiments':—'an effort
to throw off the clutch of cruel and humiliating facts by translating
them into the imaginative realm, where the artist, the author, the
dreamer even, has things as he wills, because the hold of outward
things' (such a stern and merciless one in the case of Charlotte
Brontë!) 'is thrown off at pleasure.'
But, judged as a literary and historical method, was Charlotte Brontë's
manner of treating the real Director and Directress of the Pensionnat
in the Rue d'Isabelle a justifiable or fair one? Can she be held without
fault in this; that in Paul Emanuel and in Madame Beck she painted
Monsieur and Madame Heger in a way that rendered them visible to
every one who knew them; and then placed them in fictitious
circumstances that altered the character of their actions and feelings,
in such a way as to misrepresent their true behaviour? It seems to me
that we must admit that the authoress of the Professor and of Villette
adopted an unjust literary and historical method in so far as these real
people are concerned: and that in the case of Madame Heger
especially, passion and prejudice betrayed her: and rendered her
guilty of a fault that must be recognised as a very grave one. But
when this fault has been recognised and admitted, it seems to me a
conscientious critic's duty does not compel him to scold this woman of
genius for having the passions of her kind. A great Romantic is not an
angel: and in this case the main facts about Charlotte are not her
shortcomings as a celestial being, but her transcendent merits as an
interpreter of the human heart. For my own part, I confess that after
reading Charlotte's Love-letters, I am in no mood to look for faults in
her, nor even to lend much attention to some faults that, without
looking for them, one is bound to recognise. For what a thankless and
unseemly, as well as what an unprofitable, sort of criticism is that
represented in ancient days by the youngest amongst Job's Friends,
who had such a delightfully expressive name, Elihu, the son of
Barachel the Buzite, of the kindred of Ram! Elihu's criticism of Job
(the man of genius, plunged into dire misfortune, not by any fault or
folly of his own, but by the will of the Higher Powers, who desired to
prove his virtue and to call forth his genius), is exactly the same
method of criticising men and women of genius in the same case as
Job, practised by Elihu's intellectual descendents, Buzites of the
kindred of Ram, in all countries and in every age, down to England in
the twentieth century. The fundamental doctrine of this critical
method was, and is, that 'great men are not always wise,' and that it
is the vocation of smaller men to teach them wisdom, without
'respecting their persons or giving them flattering titles' (truly, as a
matter of fact, by calling them names—knaves, hypocrites,
sentimental cads, blackguards, etc.). In other words, the rule with
these Buzites is that the main purpose of criticising great people is to
find fault with them; to surprise them in their 'unwise' moments, to
concentrate attention upon the faults they may, or may not, have
committed in these moments; and to build upon these occasional real,
or imaginary, faults, psychological and pathological theories about the
madness, wickedness, or folly of people capable of them. And to
conclude that there is 'very much to reprobate and a great deal to
laugh at' in these men and women of genius—and that the fact that
they had genius, and that as witnesses to the 'instinct of immortality
in mortal creatures' they have served and honoured mankind, and
also have bequeathed to us treasures of ideal beauty, is a mere
accident, and may be left unnoticed.
But let not my portion ever be with these fault-finders, who 'darken
counsel by words without knowledge,' as the original Elihu was told,
'out of the Whirlwind,' by the Supreme Critic; 'in whose stead' the son
of Barachel had arrogated to himself the right to scold and scoff at
Job; and to tell him that his misfortunes were all the result of his bad
character and of his uncontrolled emotions. I refuse, then, to
recognise as a question of vital importance Charlotte's forgetfulness of
historical exactitude in Villette; and I do not myself understand how
any one (except a Buzite) who has read these Letters given to us by
Dr. Paul Heger, and especially the last one, that received no answer,
can help feeling that the suffering the writer of the Letters must have
undergone, in the unbroken silent solitude that followed her
unanswered appeal, must have made the hold upon her memory of
'outward things' so hard to bear, that to break that hold, to live in the
realm of imagination free from it, having things as she would, justified
almost any method of self-liberation.
Still the fact of the critical confusion of the personages in the novel
with the historical Director and Directress of the Pensionnat in the Rue
d'Isabelle does create difficulties in the way of forming right opinions.
And to remove them, we have to follow the plan already
recommended,—to make sure of our facts, before calling in the aid of
psychological arguments. And in this case, to see the position clearly,
we must disentangle from the imaginary story in Villette the real
personages and events woven into the fabric of a parable where, as I
have said, they appear amongst fictitious circumstances and produce
consequently false impressions. In other words, we have to recover a
clear knowledge of the true Monsieur Heger before we can determine
where 'Paul Emanuel' resembles, and where he differs from, the
Professor, whom Charlotte loved: but who never showed any particle
of love for Charlotte, such as Paul Emanuel bestowed on Lucy Snowe.
And then we have to re-establish in her true place, as Monsieur
Heger's wife and the mother of his five children, the true Directress of
the Pensionnat in the Rue d'Isabelle—who must be contrasted, rather
than compared, with the crafty, jealous and pitiless Madame Beck of
the novel, selfishly and cruelly interfering with the true course of an
entirely legitimate and romantic attachment between her English
teacher and her cousin, the Professor of literature. And the relative
positions of these two Directresses clearly seen, we have to ask
ourselves, Whether the real Madame Heger is proved to have had the
base and detestable character of the hateful Madame Beck? and
whether she really was, in any voluntary or even involuntary, way, the
direct cause of poor Charlotte's anguish, suspense and final heart-
break? And whether, given the positions and the different views of life
and sense of duty of the different people whose destinies become
entangled in this tragical romance, we can find fault with any person
concerned in these events,—unless, indeed, we follow Greek
methods, and drag in the Eumenides? Or, else, suppose it a parallel
case with Job's: and decide that it was the will of the Higher Powers
to prove Charlotte's virtue and to call forth her genius? But in so far
as mere mortals are concerned, we have to see whether anything else
could have happened, and whether poor Charlotte was not bound to
break her heart?
So that the purpose of the Second Part of this study of the 'Secret of
Charlotte Brontë' really lies outside of the 'Secret' itself, and becomes
an effort to know 'as in themselves they really were,' and
independently of their relationships with Charlotte, the Professor
whom she loved (probably much more than he deserved), and the
Directress of the Pensionnat in the Rue d'Isabelle—whom she
certainly hated, without any reasonable cause for this hatred,
although this hatred had a natural cause—that if only we will use
psychology for the purpose of penetrating facts, and not for playing
with such fictions as that it was 'no serious grief to Charlotte that
Monsieur Heger was married' we may easily discover. After all, one
must not ask for entire 'reasonableness' from Romantics, who see
personages and events through the medium of one great Passion.
And one must not demand from them absolute impartiality, when
judging the impediment that divides them from the object of this
passion.
We are not judges then in this case, but enquirers into the facts of the
personality and true characters of the Director and Directress of the
Bruxelles school and of their environment, as the influences that so
largely created the Romantic atmosphere where Charlotte's genius
lived and moved and had its being. And, by the special circumstances
of my own life, I am able to assist in a way that is not (so I am
tempted to believe) possible to any other living critic. The difficulty
that stands in the way of most modern investigators is that long ago
the historical people with their environment 'have become ghostly.'
Long ago, for most readers of Villette, the once famous Pensionnat de
Jeunes Filles in the Rue d'Isabelle, with its memory-haunted class-
rooms, with its high-walled garden in the heart of a city whose voices
reached one, as from a world far away, and 'down whose peaceful
alleys it was pleasant to stray and hear the bells of St Jean Baptiste
peal out with their sweet, soft, exalted sound,' have vanished out of
life. Yes—but out of my life they have not vanished! For me—the
historical Monsieur and Madame Heger exist quite independently of all
associations with the imaginary personages Paul Emanuel and
Madame Beck. For me—the old school, the class-rooms, the walled
garden, with its ancient pear-trees that still 'faithfully renewed their
perfumed snow in spring and honey-sweet pendants in autumn,'
remain—as they were planted vivid images and visions in my memory
half a century ago, when, as a schoolgirl, I knew nothing about
Charlotte Brontë nor Villette: but when I sat, twenty years after
Charlotte, in the class-rooms where she had waited for M. Heger, on
the eve of her departure from Bruxelles, myself an attentive pupil of
her Professor, and a witness, half terrified, and half exasperated, of
his varying moods. And when, too, I saw, rather than heard, Madame
Heger, moving noiselessly, where M. Heger's movements were always
attended with shock and excitement; only to me, Madame Heger
appeared always a friendly rather than an adverse presence—an
abiding influence of serenity that reassured one, after sudden
recurrent gusts of nerve-disturbing storms.
And I would point out that the value of my testimony about the
personal impressions I derived, quite independently of any knowledge
of Charlotte Brontë's residence in what was for me my school, and of
her enthusiasm for my Professor, or her dislike of my schoolmistress,
is enhanced both by the resemblances and by the differences of our
several points of view. Thus—like Charlotte—I was an English pupil
and a Protestant in this Belgian and Catholic school. Like her—my
vocation was to be that of a woman of letters. And although, when
she was brought under M. Heger's influence, she was a woman of
genius, already well acquainted with good literature, and not without
experience as a writer, whereas I was only an unformed girl, with very
little reading and no culture: and merely by force of an inborn desire
to follow a certain purpose in life that filled me with happiness, even
in anticipation, justified in supposing that I had a literary vocation at
all, and although no doubt I have not turned my advantages to
account as Charlotte did, yet I myself owe to M. Heger, not only
admirable rules for criticism and practice, that have always claimed
and still claim my absolute belief, but also I owe to him, as she did, a
full enjoyment of beautiful thoughts, beautifully expressed, and of
treasures of the mind and of the imagination, that, lying outside of
the recognised paths of English study, I might never have found, nor
even have recognised as treasures, had I not been cured of insularity
of taste by M. Heger.
So that upon this point I am able to say of M. Heger what Charlotte
said: he was the only master in literature I ever had; and up to the
present hour I esteem him, in this domain of literary composition, the
only master whose rules I trust.
But if my judgment of M. Heger, as a Professor, coincides with
Charlotte's, my judgment of him, outside of this capacity, does not
show him to me at all as the model of the man from whom she
painted Paul Emanuel. In other words, I never found nor saw in the
real Monsieur Heger the lovableness under the outward harshness,—
the depths of tenderness under the very apparent severity and
irritability,—the concealed consideration for the feelings of others,
under the outer indifference to the feelings of any one who ruffled his
temper; nor yet did I ever discover meekness and modesty in him,
under the dogmatic and imperious manner that swept aside all
opposition. In fact, I never found out that M. Heger wore a mask. But,
irritable, imperious, harsh, not unkind, but certainly the reverse of
tender, and without any consideration for any one's feelings, or any
respect for any one's opinions, thus, just as he seemed to be, so in
reality, in my opinion, M. Heger actually was. And what one must
remember is that Charlotte's point of view, from which she formed the
opinion that M. Heger was tender-hearted, and modest and meek,
was the point of view of a woman in love; and this standpoint is not
one that ensures impartiality.
My own point of view, between 1859 and 1861, was that of an English
schoolgirl, under sixteen, of a Belgian schoolmaster, over fifty, who in
his capacity of a literary Professor, was almost a deity to her; but who,
outside of this capacity, was not a lovable, but a formidable man: a
'Terror,' in the sense children and nursery-maids give the term; that is
to say, some one who is sure to appear upon the scene when one is
least prepared to face him, and who is constantly finding fault with
one. Now a 'Terror,' in this popular sense of the term, although he is
not a lovable, is not necessarily a hateful personage. There may
belong to him an interest of excitement, and even a secret admiration
for his cleverness in fulfilling his role of taking one unawares and
finding something in one to quarrel about. And most certainly this
interest of excitement, and even of a sense of amusement, entered
into my sentiment for M. Heger, whom I recognised as a double-
being, an admirable literary Professor, but an alarming and irritating
personality. But although I never hated him, I yet had some special
grievances against this 'Terror,' not only because he had a trick of
surprising me in weak moments, and of finding out my worst sides,
but also because he was really, in my own particular case, unjust; and
full of prejudice and impatience against my nationality, and personal
idiosyncrasies that were not faults; and that I couldn't help. Thus he
stirred up in me rebellious protests, that could not be uttered;
because how was an English schoolgirl of fifteen to protest against
the injustice of a Belgian 'Master,' in his own country, and his own
school: who was a man past fifty, too; and what was more, in his
capacity of literary Professor, if not quite a deity, at least, in my own
opinion, the keeper of the keys of palaces where dwelt the
Immortals?
And that my opinion of M. Heger's personality, as that of a 'Terror' (in
the childish and popular sense) did really show me the man apart
from the Professor very much as he really was, is confirmed by the
first impression he made upon Charlotte herself before the glamour of
romantic love had interfered with her critical perspicacity. Here is the
original description of M. Heger, in the early days of her residence in
Bruxelles:
'There is one individual of whom I have not yet spoken,' she wrote to
Ellen Nussey, 'M. Heger, the husband of Madame. He is Professor of
rhetoric: a man of power as to mind, but very choleric and irritable in
temperament, a little black being, with a face that varies in
expression. Sometimes he borrows the lineaments of a tom-cat:
sometimes those of a delirious hyena: occasionally, but very seldom,
he discards these perilous attractions and assumes an air not above
one hundred degrees removed from mild and gentleman-like. He is
very angry with me just now, because I have written a translation
which he stigmatises as peu correct. He did not tell me so, but wrote
the word on the margin of my book and asked me, in very stern
phrase, how it happened that my compositions were always better
than my translations, adding that the thing seemed to him
inexplicable. The fact is that three weeks ago in a high-flown humour
he forbade me to use either dictionary or grammar when translating
the most difficult English composition into French. This makes the
task rather arduous, and compels me every now and then to
introduce an English word, which nearly plucks the eyes out of his
head when he sees it. Emily and he don't draw well together at all.'
I am quoting this view of M. Heger's personality, taken by Charlotte
Brontë before she became a partial witness, because, by and by,
when I am giving my own reminiscences, it will be found that in 1842
M. Heger was very much the same Professor whom I knew in 1861.
And Madame Heger? Here too my impressions are obtained from a
point of view unquestionably more impartial than Charlotte Brontë's.
And it will be found that, when the alteration of clear power of vision
that personal prejudices make has been realised, my opposite
judgment of the Directress of the Pensionnat to the judgment of the
authoress of Villette, is not the result of any difference in the facts of
Madame Heger's characteristics and behaviour, but in the difference
between the standpoints from which we severally judge them.
Charlotte's standpoint was the one of the devotee, of the great spirit
who is neither a god nor a mortal, but the 'Child of plenty and
poverty, who is often houseless and homeless'—and who cannot well
see 'as in herself she really is,' the Mistress of the house; who
prudently, not necessarily with cruelty, closes the doors of her home
against intruders—that standpoint also is not one conducive to
impartial judgments.
My own point of view was that of a girl on the threshold of
womanhood, who saw in Madame Heger an embodiment of two
qualities especially, that, perhaps because I did not possess them and
could never possess them (passionate as I was by nature and with
strong personal likings and dislikings), inspired me with a sentiment of
reverence and wonder, as for a remote perfection, that, though
unattainable, it did one good to know existed somewhere; just as it
does one good, with feet planted on the earth, to see the stars. The
qualities I saw in Madame Heger were serene sweetness, a kindness
without preferences, covering her little world of pupils and teachers
with a watchful care. Tranquillité, Douceur, Bonté: the French words
express better than English ones the commingled qualities I felt
existed in Madame Heger as she moved noiselessly (as Charlotte
Brontë has described), whilst the more brilliant and gifted Professor's
movements were always stormy.
When relating these reminiscences of Monsieur and Madame Heger
and of the old school and garden, as I myself treasure them, and
quite independently of their associations with Charlotte Brontë, I shall
not be losing sight of the purpose that justifies this record (as an
endeavour to disentangle fact from fiction) if, in so far as the facts
that concern my own experiences are concerned, I ask now to be
allowed to relate them in a different tone—that is to say, not any
longer in the tone of a literary critic, nor as one supporting any thesis
or argument, but simply as a story-teller 'who has been young and
now is old.' And who, before the darkening day has turned to night,
calls to remembrance scenes and personages long since vanished out
of the world, but still alive for me, bathed in the light that shines upon
the undimmed visions of my youth—although to almost every one else
now alive these scenes have become 'as it were a tale that is told.'
CHAPTER II
[1]
CHAPTER III
ebookbell.com