Snell,Tidwell - Programming Web Services with SOAP (O'Reilly, 2001).pdf

(1133 KB) Pobierz
Microsoft Word - book.doc
15174398.001.png
Programming Web Services with SOAP
Doug Tidwell
James Snell
Pavel Kulchenko
Publisher: O'Reilly
First Edition December 2001
ISBN: 0-596-00095-2, 216 pages
Programming Web Services with SOAP introduces you to building distributed Wb-based
applications using the SOAP, WSDL, and UDI protocols. You'll learn the XML underlying
these standards, as well as how to use the popular toolkits for Java and Perl. The book also
addresses security and other enterprise issues.
Table of Contents
Preface ...........................................................
Audience for This Book ...............................................
Structure of This Book ...............................................
Conventions ......................................................
Comments and Questions ..............................................
Acknowledgments ..................................................
1
1
2
3
3
4
1. Introducing Web Services ............................................
1.1 What Is a Web Service? ............................................
1.2 Web Service Fundamentals ..........................................
1.3 The Web Service Technology Stack ...................................
1.4 Application ...................................................
1.5 The Peer Services Model ..........................................
6
6
6
10
13
13
2. Introducing SOAP ................................................
2.1 SOAP and XML ................................................
2.2 SOAP Messages ................................................
2.3 SOAP Faults ..................................................
2.4 The SOAP Message Exchange Model ..................................
2.5 Using SOAP for RPC-Style Web Services ...............................
2.6 SOAP's Data Encoding ............................................
2.7 SOAP Data Types ...............................................
2.8 SOAP Transports ...............................................
21
21
17
22
25
27
29
32
36
3. Writing SOAP Web Services .........................................
3.1 Web Services Anatomy 101 ........................................
3.2 Creating Web Services in Perl with SOAP::Lite ...........................
3.3 Creating Web Services in Java with Apache SOAP .........................
3.4 Creating Web Services In .NET ......................................
3.5 Interoperability Issues ............................................
39
39
41
46
52
58
4. The Publisher Web Service ..........................................
4.1 Overview .....................................................
4.2 The Publisher Operations ..........................................
4.3 The Publisher Server .............................................
4.4 The Java Shell Client .............................................
62
62
63
64
71
5. Describing a SOAP Service ..........................................
5.1 Describing Web Services ..........................................
5.2 Anatomy of a Service Description ....................................
5.3 Defining Data Types and Structures with XML Schemas .....................
5.4 Describing the Web Service Interface ..................................
5.5 Describing the Web Service Implementation ..............................
5.6 Understanding Messaging Patterns ....................................
79
79
83
83
85
86
90
6. Discovering SOAP Services ..........................................
6.1 The UDDI Registry ..............................................
6.2 The UDDI Interfaces .............................................
6.3 Using UDDI to Publish Services ....................................
6.4 Using UDDI to Locate Services .....................................
6.5 Generating UDDI from WSDL .....................................
6.6 Using UDDI and WSDL Together ...................................
6.7 The Web Service Inspection Language (WS-Inspection) .....................
93
93
96
101
105
106
109
111
7. Web Services in Action ............................................
7.1 The CodeShare Service Network ....................................
7.2 The Code Share Index ...........................................
7.3 Web Services Security ...........................................
7.4 Definitions and Descriptions .......................................
7.5 Implementing the CodeShare Server ..................................
7.6 Implementing the CodeShare Owner ..................................
7.7 Implementing the CodeShare Client ..................................
7.8 Seeing It in Action ..............................................
7.9 What's Missing from This Picture? ...................................
7.10 Developing CodeShare ..........................................
114
114
118
120
123
128
137
141
143
143
144
8. Web Services Security ............................................
8.1 What Is a "Secure" Web Service? ....................................
8.2 Microsoft Passport, Version 1.x and 2.x ................................
8.3 Microsoft Passport, Version 3.x .....................................
8.4 Give Me Liberty or Give Me ... .....................................
8.5 A Magic Carpet ...............................................
8.6 The Need for Standards ..........................................
8.7 XML Digital Signatures and Encryption ...............................
145
145
147
148
149
149
149
149
9. The Future of Web Services ........................................
9.1 The Future of Web Development ....................................
9.2 The Future of SOAP ............................................
9.3 The Future of WSDL ............................................
9.4 The Future of UDDI ............................................
9.5 Web Services Battlegrounds .......................................
9.6 Technologies .................................................
9.7 Web Services Rollout ............................................
151
151
152
152
155
156
158
163
A. Web Service Standardization .......................................
A.1 Packaging Protocols ............................................
A.2 Description Protocols ...........................................
A.3 Discovery Protocols ............................................
A.4 Security Protocols ..............................................
A.5 Transport Protocols .............................................
A.6 Routing and Workflow ..........................................
A.7 Programming Languages/Platforms ..................................
165
165
165
166
167
168
168
168
B. XML Schema Basics .............................................
B.1 Simple and Complex Types .......................................
B.2 Some Examples ...............................................
B.3 XML Spy ...................................................
170
170
172
175
C. Code Listings ..................................................
C.1 Hello World in Perl .............................................
C.2 Hello World Client in Visual Basic ..................................
C.3 Hello World over Jabber .........................................
C.4 Hello World in Java ............................................
C.5 Hello, World in C# on .NET .......................................
C.6 Publisher Service ..............................................
C.7 SAML Generation ..............................................
C.8 Codeshare ...................................................
177
177
177
178
178
179
181
194
207
Colophon .......................................................
221
Programming Web Services with SOAP
Preface
You'd be hard-pressed to find a buzzword hotter than web services . Breathless articles
promise that web services will revolutionize business, open new markets, and change the way
the world works. Proponents call web services "The Third-Generation Internet," putting them
on a par with email and the browseable web. And no protocol for implementing web services
has received more attention than SOAP, the Simple Object Access Protocol.
This book will give you perspective to make sense of all the hype. When you finish this book,
you will come away understanding three things: what web services are, how they are written
with SOAP, and how to use other technologies with SOAP to build web services for the
enterprise.
While this book is primarily a technical resource for software developers, its overview of the
relevant technologies, development models, standardization efforts, and architectural
fundamentals can be easily grasped by a nontechnical audience wishing to gain a better
understanding of this emerging set of new technologies.
For the technical audience, this book has several things to offer:
A detailed walk-through of the SOAP, WSDL, UDDI, and related specifications
Source code and commentary for sample web services
Insights on how to address issues such as security and reliability in enterprise
environments
Web services represent a powerful new way to build software systems from distributed
components. But because many of the technologies are immature or only address parts of the
problem, it's not a simple matter to build a robust and secure web service. A web service
solution today will either dodge tricky issues like security, or will be developed using many
different technologies. We have endeavored to lay a roadmap to guide you through the many
possible technologies and give you sound advice for developing web services.
Will web services revolutionize everything? Quite possibly, but it's not likely to be as
glamorous or lucrative, or happen as quickly as the hype implies. At the most basic level, web
services are plumbing, and plumbing is never glamorous. The applications they make possible
may be significant in the future, and we discuss Microsoft Passport and Peer-to-Peer (P2P)
systems built with web services, but the plumbing that enables these systems will never be
sexy.
Part of the fundamental utility of web services is their language independence—we come
back to this again and again in the book. We show how Java, Perl, C#, and Visual Basic code
can be easily integrated using the web services architecture, and we describe the underlying
principles of the web service technologies that transcend the particular programming language
and toolkit you choose to use.
Audience for This Book
There's a shortage of good information on web services at all levels. Managers are being
bombarded with marketing hyperbole and wild promises of efficiency, riches, and new
page 1
Zgłoś jeśli naruszono regulamin