Cover image for Designing Web services with the J2EE 1.4 platform : JAX-RPC, SOAP, and XML technologies
Title:
Designing Web services with the J2EE 1.4 platform : JAX-RPC, SOAP, and XML technologies
Series:
The Java series
Publication Information:
Boston, MA : Addison-Wesley, 200
Physical Description:
1v + 1 CD-ROM
ISBN:
9780321205216
General Note:
Accompanied by compact disc : CP 7703
Added Author:

Available:*

Library
Item Barcode
Call Number
Material Type
Item Category 1
Status
Searching...
30000004707737 QA76.73.J38 D47 2004 Open Access Book Book
Searching...

On Order

Summary

Summary

Written by Sun Microsystems' Java' BluePrints team, this book is a guide to designing and integrating enterprise-level Web services using the Java 2 Platform, Enterprise Edition (J2EE) 1.4. It provides the guidelines, patterns, and real-world examples for architects and developers.


Author Notes

Inderjeet Singh is lead architect on the Java BluePrints Team, where he works with other architects and engineers to define best uses of Java technologies for application design. Beth Stearns is the principal partner of ComputerEase Publishing, a computer consulting firm she founded in 1982. Among her publications are Java Native Interface in The Java Tutorial Continued (Addison-Wesley), "The EJB Programming Guide" for Inprise Corporation, and " Understanding EDT, " a guide to Digital Equipment Corporation's text editor.




Excerpts

Excerpts

This book describes designing Web services using the current technologies available with the Java™ 2 Platform, Enterprise Edition. This book and the accompanying Java™ Adventure Builder Reference application (hereafter referred to as adventure builder) are part of the successful Java BluePrints program created by Sun Microsystems with the introduction of the J2EE platform. Application architects, developers, and students everywhere have used this program to better understand the programming model inherent in the J2EE platform. Rather than providing information on how to use individual Java technologies to write applications, which falls within the realm of the companion Java Tutorial program, the Java BluePrints focuses on guidelines for application architecture and design, such as distributing J2EE application functionality across tiers and choosing among design options for Web services endpoints. This book describes the Web services and related technologies of the J2EE platform. Its focus is how to best apply these J2EE platform technologies to writing Web service applications. This book assumes that you have a basic knowledge of the J2EE platform, which you can get from The J2EE™ Tutorial , and is meant to be read in conjunction with Designing Enterprise Applications with the J2EE Platform, Second Edition , since that book covers the J2EE platform technologies for writing traditional enterprise applications. This book is intended primarily for enterprise architects and application developers engaged in or considering writing Web services and Web service applications with the J2EE platform. It is also useful for product vendors interested in developing Web service applications consistent with the J2EE platform standard. Obtaining the Reference Application The adventure builder reference application, which is described in this book, is available on the compact disk included with this book. You can also download it from: http://java.sun.com/blueprints/code/ The application requires a J2EE version 1.4-compliant platform on which to run. The accompanying compact disk includes an implementation of this platform and an application server. You can download the J2EE SDK™, which is a freely available implementation of that platform, from: http://java.sun.com/j2ee/download.html The Java BluePrints Web site includes additional content, available only online, that describes in detail the architecture of the Java adventure builder sample application. References and Resources Pointers to J2EE documentation can be found at: http://java.sun.com/j2ee/1.4/docs For information on how to use the J2EE SDK to construct multi-tier enterprise applications, refer to the J2EE Tutorial , available at: http://java.sun.com/j2ee/1.4/docs/tutorial/docs We relied on many of the following references for technical details and background. These references are good sources for those interested in exploring Web services in greater detail. Designing Enterprise Applications with the J2EE Platform, Second Edition. I. Singh, B. Stearns, M. Johnson, Enterprise Team. Copyright 2002, Addison-Wesley. The Java BluePrints Web site, < http://java.sun.com/blueprints >. Core J2EE Patterns: Best Practices and Design Strategies, Second Edition. D. Alur, D. Malks, J. Crupi. Copyright 2003, Prentice Hall PTR. Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions. G. Hohpe, B. Woolf. Copyright 2003, Addison-Wesley. The Web services standards cited in this book are: WS-I Basic Profile, Version 1.0. Available at < http://www.ws-i.org >. Simple Object Access Protocol, Version 1.1. Available at < http://www.w3.org >. Extensible Markup Language (XML), Version 1.0. Available at < http://www.w3.org >. Web Services Description Language, Version 1.1. Available at < http://www.w3.org >. XML Schema, Part 1 and 2. Available at < http://www.w3.org >. Universal Description, Discovery and Integration (UDDI), Version 2. Available at < http://www.w3.org >. The J2EE technologies cited in this book are described in their specifications: Java™ 2 Platform, Enterprise Edition Specification, Version 1.4 (J2EE specification). Available at < http://java.sun.com/j2ee/ > Java™ API for XML-Based RPC Specification, Version 1.1 (JAXP specification). Available at < http://java.sun.com/xml/jaxrpc/ > Java™ API for XML Processing Specification, Version 1.2 (JAXP specification). Available at < http://java.sun.com/xml/jaxp/ > SOAP with Attachments API for Java Specification, Version 1.2 (SAAJ specification). Availa ble at < http://java.sun.com/xml/saaj/ > Java API for XML Registries Specification, Version 1.0 (JAXR specification). Available at < http://java.sun.com/xml/jaxr/ > Web Services for J2EE Specification, Version 1.1. Available at < ftp://www.ibm.com/pub/jsr109/spec1.1/ > Java API for XML Binding Specification (JAXB specification). Available at < http://java.sun.com/xml/jaxb/ > Java™ Servlet Specification, Version 2.4 (Servlet specification). Available at < http://java.sun.com/products/servlet/ > JavaServer Pages™ Specification, Version 2.0 (JSP specification). Available at < http://java.sun.com/products/jsp/ > Enterprise JavaBeans™ Specification, Version 2.1 (EJB specification). Available at < http://java.sun.com/products/ejb/ > J2EE™ Connector Architecture Specification, Version 1.5 (Connector specification). Available at < http://java.sun.com/j2ee/connector/ > Java™ Message Service Specification, Version 1.0.2 (JMS specification). Available at < http://java.sun.com/products/jms/ > How This Book Is Organized This book is divided into the following chapters: Chapter 1, "Introduction," describes Web services and explains the support provided by the J2EE 1.4 platform for Web services. Chapter 2, "Standards and Technologies," enumerates and describes in detail the Web services-specific component, service, and communication technologies supported by the J2EE 1.4 platform. Chapter 3, "Service Endpoint Design," describes how best to design and implement a Web service endpoint. Chapter 4, "XML Processing," addresses in detail the issues for designing and developing XML-based applications and handling XML documents. In particular, it focuses on those issues that are of most concern to Web service endpoints and clients. Chapter 5, "Client Design," describes the different communication modes that J2EE and non-J2EE clients alike use to access Web services. It includes guidelines and techniques for writing efficient Web service client applications. Chapter 6, "Enterprise Application Integration," describes the capabilities provided by the J2EE platform for using Web services to integrate applications and data, and shows how to best use these capabilities in an enterprise application. Chapter 7, "Security," describes the J2EE security model and how it applies to Web service endpoints and clients. Chapter 8, "Application Architecture and Design," pulls the topics in the preceding chapters together into a coherent programming model that illustrates how best to design and develop Web service endpoints and clients. "Glossary" is a list of words and phrases found in this book and their definitions. Excerpted from Designing Web Services with the J2EE 1. 4 Platform: JAX-RPC, SOAP, and XML Technologies by Inderjeet Singh, Sean Brydon, Greg Murray, Vijay Ramachandran, Thierry Violleau, Beth Stearns All rights reserved by the original copyright owners. Excerpts are provided for display purposes only and may not be reproduced, reprinted or distributed without the written permission of the publisher.

Table of Contents

Forewordp. xiii
About the Authorsp. xvii
Prefacep. xix
1 Introductionp. 1
1.1 What Are Web Services?p. 3
1.2 Benefits of Web Servicesp. 6
1.3 Challenges of Web Service Developmentp. 8
1.3.1 Evolving Technologies and Productsp. 8
1.3.2 Securityp. 9
1.3.3 Reliability, Availability, and Scalabilityp. 10
1.4 Typical Web Service Scenariosp. 11
1.4.1 Interacting with Business Partnersp. 14
1.4.2 Integrating with Existing Enterprise Information Systemsp. 15
1.4.3 Reaching Diverse Clientsp. 15
1.4.4 Aggregation of Partner Datap. 16
1.5 J2EE 1.4: The Platform for Web Servicesp. 17
1.5.1 J2EE Platform Overviewp. 17
1.5.2 J2EE Platform Benefitsp. 19
1.5.3 J2EE Platform Technologiesp. 21
1.6 Conclusionp. 24
2 Standards and Technologiesp. 27
2.1 Overview of Web Service Standardsp. 27
2.1.1 Extensible Markup Languagep. 29
2.1.2 Simple Object Access Protocolp. 33
2.1.3 Registry Standardsp. 35
2.1.4 Web Services Description Languagep. 36
2.1.5 Emerging Standardsp. 40
2.2 J2EE: The Integrated Platform for Web Servicesp. 40
2.2.1 Java APIs for XML Processingp. 41
2.2.2 Java API for XML-Based RPCp. 44
2.2.3 Java API for XML Registriesp. 47
2.2.4 SOAP with Attachments API for Javap. 48
2.2.5 Web Service Technologies Integrated in J2EE Platformp. 49
2.2.6 Support for WS-I Basic Profilep. 51
2.3 Other Java-XML Technologiesp. 52
2.4 Conclusionp. 54
3 Service Endpoint Designp. 57
3.1 Example Scenariosp. 58
3.2 Flow of a Web Service Callp. 59
3.3 Key Web Services Design Decisionsp. 61
3.4 Designing a Service's Interaction Layerp. 66
3.4.1 Designing the Interfacep. 66
3.4.2 Receiving Requestsp. 89
3.4.3 Delegating Web Service Requests to Processing Layerp. 92
3.4.4 Formulating Responsesp. 98
3.5 Processing Layer Designp. 99
3.6 Publishing a Web Servicep. 101
3.6.1 Publishing a Service in a Registryp. 101
3.6.2 Understanding Registry Conceptsp. 102
3.6.3 Registry Implementation Scenariosp. 103
3.7 Handling XML Documents in a Web Servicep. 105
3.7.1 Exchanging XML Documentsp. 107
3.7.2 Separating Document Manipulation from Processing Logicp. 111
3.7.3 Fragmenting XML Documentsp. 111
3.7.4 Using XMLp. 111
3.7.5 Using JAXM and SAAJ Technologiesp. 112
3.8 Deploying and Packaging a Service Endpointp. 113
3.8.1 Service Information in the Deployment Descriptorsp. 113
3.8.2 Package Structurep. 117
3.9 Conclusionp. 119
4 XML Processingp. 121
4.1 XML Overviewp. 122
4.1.1 Document Type and W3C XML Schema Definitionsp. 125
4.1.2 XML Horizontal and Vertical Schemasp. 126
4.1.3 Other Specifications Related to XMLp. 127
4.2 Outline for Handling XML Documentsp. 128
4.3 Designing XML-Based Applicationsp. 131
4.3.1 Designing Domain-Specific XML Schemasp. 131
4.3.2 Receiving and Sending XML Documentsp. 135
4.3.3 Validating XML Documentsp. 139
4.3.4 Mapping Schemas to the Application Data Modelp. 143
4.3.5 Choosing Processing Modelsp. 151
4.3.6 Fragmenting Incoming XML Documentsp. 153
4.3.7 Abstracting XML Processing from Application Logicp. 155
4.3.8 Design Recommendation Summaryp. 163
4.4 Implementing XML-Based Applicationsp. 164
4.4.1 Choosing an XML Processing Programming Modelp. 164
4.4.2 Combining XML Processing Techniquesp. 176
4.4.3 Entity Resolutionp. 178
4.5 Performance Considerationsp. 182
4.5.1 Limit Parsing of Incoming XML Documentsp. 184
4.5.2 Use the Most Appropriate APIp. 184
4.5.3 Choose Effective Parser and Style Sheet Implementationsp. 186
4.5.4 Reduce Validation Costp. 188
4.5.5 Reduce the Cost of Referencing External Entitiesp. 189
4.5.6 Cache Dynamically Generated Documentsp. 193
4.5.7 Use XML Judiciouslyp. 194
4.6 Conclusionp. 196
5 Client Designp. 199
5.1 Choosing a Communication Technologyp. 200
5.2 Scenarios for Web Services-Based Client Applicationsp. 201
5.2.1 Designing J2EE Clientsp. 205
5.2.2 Designing J2SE Clientsp. 207
5.2.3 J2ME Clientsp. 208
5.3 Developing Client Applications to Use a Web Servicep. 210
5.3.1 Communication Modes for Accessing a Servicep. 212
5.3.2 Locating and Accessing a Servicep. 219
5.3.3 Stubs and Call Configurationp. 223
5.3.4 WSDL-to-Java Type Mappingp. 225
5.3.5 Processing Return Valuesp. 227
5.3.6 Handling Exceptionsp. 230
5.4 General Considerationsp. 235
5.4.1 Managing Conversational Statep. 235
5.4.2 Enhancing User Experiencep. 237
5.4.3 Server-Side Design Considerations for Clientsp. 239
5.4.4 Packagingp. 240
5.5 Conclusionp. 245
6 Enterprise Application Integrationp. 247
6.1 Integration Requirements and Scenariosp. 248
6.1.1 Typical Integration Scenariosp. 248
6.1.2 Example Integration Scenariosp. 249
6.2 J2EE Integration Technologiesp. 252
6.2.1 Relational Database Integration Technologiesp. 253
6.2.2 Messaging Technologiesp. 255
6.2.3 EIS Access Technologiesp. 259
6.2.4 Web Service and XML Technologiesp. 262
6.3 Integration Design Approachesp. 263
6.3.1 Web Services Approachp. 266
6.3.2 Enterprise Beans and JMS Approachp. 271
6.3.3 The Connector Approachp. 271
6.3.4 Combining Approaches into an Integration Architecturep. 272
6.4 Data Integration Guidelinesp. 274
6.4.1 Data Mapping in EAI Applicationsp. 274
6.4.2 Data Transformationp. 275
6.4.3 Data Filteringp. 282
6.5 Guidelines for Integrationp. 283
6.5.1 Integrating Custom Legacy Systemsp. 283
6.5.2 Using Screen Scraping for Integrationp. 284
6.5.3 Metadatap. 285
6.5.4 Using Registries for Integrationp. 286
6.5.5 Versioning and Evolutionp. 286
6.5.6 Writing Applications for Integrationp. 288
6.6 Conclusionp. 288
7 Securityp. 291
7.1 Security Scenariosp. 292
7.1.1 General Security Requirementsp. 293
7.1.2 Security Implications of the Operational Environmentp. 297
7.2 J2EE Platform Security Modelp. 297
7.2.1 Authenticationp. 299
7.2.2 Authorizationp. 304
7.2.3 Confidentiality and Integrityp. 307
7.3 Security for Web Service Interactionsp. 308
7.3.1 Endpoint Programming Modelp. 308
7.3.2 Client Programming Modelp. 314
7.3.3 Propagating Component Identityp. 316
7.3.4 Handling Authorizationp. 320
7.3.5 JAX-RPC Security Guidelinesp. 324
7.4 Message-Level Web Service Securityp. 326
7.4.1 Understanding Message-Level Securityp. 326
7.4.2 Comparing Security Mechanismsp. 328
7.4.3 Emerging Message-Level Security Standardsp. 331
7.5 Conclusionp. 337
8 Application Architecture and Designp. 339
8.1 Overview of Adventure Builderp. 339
8.1.1 Order Processing Center Sub-Modules and Interactionsp. 342
8.2 Order Processing Center Architecture and Designp. 344
8.2.1 Web Service Interaction and Message Exchangep. 345
8.2.2 Communication Architecturep. 349
8.3 Endpoint Design Issuesp. 351
8.3.1 Web Service Interface Development Approachp. 351
8.3.2 Endpoint Type Considerationsp. 352
8.3.3 Granularity of Servicep. 353
8.3.4 Passing Parameters as Documents or Java Objectsp. 353
8.3.5 Layering the Servicep. 355
8.3.6 Delegating to Business Logicp. 357
8.3.7 Client Considerationsp. 357
8.3.8 Publishing Web Service Detailsp. 358
8.4 Web Service Communication Patternsp. 358
8.4.1 Correlating Messagesp. 359
8.4.2 Splitting and Joining Messagesp. 361
8.4.3 Refactoring Synchronous to Asynchronous Interactionsp. 363
8.5 Managing Complex Web Service Interactionsp. 366
8.5.1 Passing Context Information on Web Service Callsp. 366
8.5.2 Handling Multiple Document Typesp. 371
8.5.3 Consolidating Web Service Interactionsp. 373
8.5.4 Canonical Data Modelp. 375
8.6 Building More Robust Web Servicesp. 376
8.6.1 Use Idempotent Endpointsp. 377
8.6.2 Use Client Retries with Idempotent Endpointsp. 378
8.6.3 Handling Asynchronous Interaction Error Conditionsp. 379
8.7 Conclusionp. 381
Glossaryp. 383
Indexp. 403