Connecting Enterprise Applications To WebSphere Enterprise Service Bus

Transcription

Front coverConnecting EnterpriseApplications toWebSphere EnterpriseService BusPatterns with worked examples formany integration scenariosCode-free connection to CICSusing WebSphere MQIntegrate Web 2.0 intothe service busPeter SwithinbankSrinivas BandaruGraham CrooksAndrew FerrierJenny HeRaghunath KrishnaswamyVijay MannMuriel Vialeibm.com/redbooks

International Technical Support OrganizationConnecting Enterprise Applications to WebSphereEnterprise Service BusSeptember 2007SG24-7406-00

Note: Before using this information and the product it supports, read the information in“Notices” on page xi.First Edition (September 2007)This edition applies to Version 6.0.2 of WebSphere Enterprise Service Bus. Copyright International Business Machines Corporation 2007. All rights reserved.Note to U.S. Government Users Restricted Rights -- Use, duplication or disclosure restricted by GSA ADPSchedule Contract with IBM Corp.

ContentsNotices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiTrademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiiPreface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiiiChoice of examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvAudience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvThe team that wrote this book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviBecome a published author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xixComments welcome. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxPart 1. Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1Chapter 1. Connecting enterprise applications . . . . . . . . . . . . . . . . . . . . . . 31.1 Introduction to integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.1.1 Process-focused integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.1.2 Data-focused integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.1.3 Which pattern of application integration . . . . . . . . . . . . . . . . . . . . . . . 61.2 EAI patterns. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81.2.1 Direct connection or point-to-point integration . . . . . . . . . . . . . . . . . . 81.2.2 Broker or hub and spoke integration . . . . . . . . . . . . . . . . . . . . . . . . . . 91.2.3 Serial Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91.2.4 Parallel Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91.3 Evolution of Enterprise Application Integration (EAI) . . . . . . . . . . . . . . . . 101.3.1 Incompatible architectures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111.3.2 Batch-oriented applications written in silos . . . . . . . . . . . . . . . . . . . . 111.3.3 Data sharing through files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131.3.4 Near real-time communication - Client Server Systems . . . . . . . . . . 131.3.5 Point-to-point integration with Remote Procedure Calls (RPCs). . . . 141.3.6 Message Oriented Middleware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161.3.7 Adapters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181.3.8 Message Brokering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191.3.9 Data synchronization. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211.3.10 Business process management . . . . . . . . . . . . . . . . . . . . . . . . . . . 211.3.11 Impact of the Internet and emergence of Web services . . . . . . . . . 221.3.12 Web 2.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231.4 Service-oriented architecture (SOA) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251.4.1 Definition of a service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261.4.2 SOA and Web services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261.4.3 SOA and EAI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Copyright IBM Corp. 2007. All rights reserved.iii

1.4.4 Enterprise Service Bus (ESB) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281.4.5 SOA reference architecture. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331.4.6 SOA programming model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351.5 Building an SOA - IBM software offerings . . . . . . . . . . . . . . . . . . . . . . . . . 371.5.1 WebSphere MQ and Extended Security Edition . . . . . . . . . . . . . . . . 401.5.2 WebSphere Message Broker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401.5.3 WebSphere Enterprise Service Bus . . . . . . . . . . . . . . . . . . . . . . . . . 411.5.4 WebSphere adapters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411.5.5 WebSphere DataPower Integration Appliances . . . . . . . . . . . . . . . . 421.5.6 WebSphere Process Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421.5.7 WebSphere Partner Gateway . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421.5.8 WebSphere Service Registry and Repository . . . . . . . . . . . . . . . . . . 431.5.9 IBM WebSphere Business Integration for Financial Networks . . . . . 431.5.10 WebSphere Business Services Fabric . . . . . . . . . . . . . . . . . . . . . . 431.6 Web 2.0 - next generation Web services . . . . . . . . . . . . . . . . . . . . . . . . . 431.6.1 Communicating over HTTP using non SOAP data . . . . . . . . . . . . . . 441.6.2 An example SOAP message. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441.6.3 Web service expecting non standard SOAP headers . . . . . . . . . . . . 451.6.4 XML-RPC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461.6.5 REST. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471.6.6 JSON RPC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481.7 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50Chapter 2. Service Component Architecture . . . . . . . . . . . . . . . . . . . . . . . 512.1 Service Component Architecture. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522.2 Service Data Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59Chapter 3. Connecting to the WebSphere Enterprise Service Bus . . . . . 633.1 Overview of WebSphere Enterprise Service Bus . . . . . . . . . . . . . . . . . . . 653.2 Business objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 673.3 Data Bindings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 683.4 WebSphere Enterprise Service Bus SCA Components . . . . . . . . . . . . . . 693.4.1 Java components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693.4.2 Mediation flow components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 733.5 WebSphere ESB Transport Binding Types . . . . . . . . . . . . . . . . . . . . . . . . 823.5.1 SCA default bindings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 823.5.2 Web services bindings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 823.5.3 JMS bindings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 833.5.4 MQ native and MQ/JMS bindings . . . . . . . . . . . . . . . . . . . . . . . . . . 893.5.5 Stateless session bean bindings . . . . . . . . . . . . . . . . . . . . . . . . . . . 963.5.6 EIS bindings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 973.5.7 Stand-alone references . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 973.6 Reference table of possible connection types. . . . . . . . . . . . . . . . . . . . . . 98ivConnecting Enterprise Applications to WebSphere Enterprise Service Bus

3.7 J2EE and WebSphere Application Server technology underlying WebSphereESB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 993.8 Using clients with WebSphere ESB . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1033.8.1 XMS clients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1043.8.2 Web services client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1043.9 Other SCA component types in the WebSphere family . . . . . . . . . . . . . 105Chapter 4. Adapters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1074.1 Why use an adapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1084.2 WebSphere JCA adapters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1094.2.1 JCA background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1104.2.2 JCA technical overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1114.2.3 Base JCA resource adapters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1134.2.4 WebSphere JCA Adapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1144.2.5 Different types of WebSphere JCA Adapters . . . . . . . . . . . . . . . . . 1154.2.6 Custom WebSphere JCA Adapters. . . . . . . . . . . . . . . . . . . . . . . . . 1184.3 WebSphere Business Integration adapter. . . . . . . . . . . . . . . . . . . . . . . . 1194.3.1 WBI Adapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1204.3.2 How to use a WBI Adapter with the enterprise service bus . . . . . . 1214.3.3 Quality of service of WBI Adapter . . . . . . . . . . . . . . . . . . . . . . . . . . 1224.4 Conclusion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122Part 2. Scenarios and patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125Patterns for e-Business . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126Chapter 5. Business scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1295.1 Case 1: insurance claims and call center . . . . . . . . . . . . . . . . . . . . . . . . 1315.1.1 Scenario 1: claimants’ access to claims information . . . . . . . . . . . . 1315.1.2 Scenario 2: insurance brokers’ access to customer policies. . . . . . 1335.2 Case 2: banking and fraud management . . . . . . . . . . . . . . . . . . . . . . . . 1345.2.1 Scenario 3: interaction with external fraud agency . . . . . . . . . . . . . 1355.2.2 Scenario 4: interaction with packaged fraud application . . . . . . . . . 1375.3 Case 3: automotive spare parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1385.3.1 Scenario 5: integration of the dealer network . . . . . . . . . . . . . . . . . 1405.3.2 Scenario 6: integration of a third-party supplier . . . . . . . . . . . . . . . 1415.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142Chapter 6. Connection patterns. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1436.1 Connection pattern 1: integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1446.1.1 Challenges and assumptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1446.1.2 Solution options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1446.1.3 Simple WebSphere MQ integration. . . . . . . . . . . . . . . . . . . . . . . . . 1486.2 Connection pattern 2: packaged application integration . . . . . . . . . . . . . 1496.2.1 Challenges and assumptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149Contentsv

6.2.2 Solution options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1496.2.3 Further information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1516.3 Connection pattern 3: batch integration . . . . . . . . . . . . . . . . . . . . . . . . . 1516.3.1 Challenges and assumptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1526.3.2 Solution options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1526.4 Connection pattern 4: event-driven integration . . . . . . . . . . . . . . . . . . . . 1576.4.1 Challenges and assumptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1576.4.2 Solution options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1586.5 Connection pattern 5: custom application integration . . . . . . . . . . . . . . . 1606.5.1 Challenges and assumptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1606.5.2 Solution options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1616.6 Connection pattern 6: Web integration . . . . . . . . . . . . . . . . . . . . . . . . . . 1646.6.1 Challenges and assumptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1646.6.2 Solution options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165Part 3. Working examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171Chapter 7. Integration using WebSphere MQ . . . . . . . . . . . . . . . . . . . . . . 1737.1 Custom data bindings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1767.2 Create mediation module project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1777.2.1 Enable the J2EE capabilities of your workbench . . . . . . . . . . . . . . 1777.2.2 Create the mediation module project . . . . . . . . . . . . . . . . . . . . . . . 1787.3 Create business objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1797.3.1 Create claimID business object. . . . . . . . . . . . . . . . . . . . . . . . . . . . 1807.3.2 Create claimResult business object . . . . . . . . . . . . . . . . . . . . . . . . 1827.4 Create interface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1837.5 Implement WebSphere MQ Data Binding . . . . . . . . . . . . . . . . . . . . . . . . 1847.6 Assemble the mediation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1917.6.1 Add mediation flow component . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1927.6.2 Generate a SOAP/http Web service export . . . . . . . . . . . . . . . . . . 1947.6.3 Create an import . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1957.6.4 Bind the import to WebSphere MQ . . . . . . . . . . . . . . . . . . . . . . . . . 1967.7 Implement the mediation flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1997.8 MQClient implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2017.8.1 Create MQClient Java program . . . . . . . . . . . . . . . . . . . . . . . . . . . 2027.9 Deploy and test the application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2087.9.1 Create servers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2087.9.2 Deploy applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2097.9.3 Testing the application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2127.9.4 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214Chapter 8. Custom CICS integration using WebSphere MQ . . . . . . . . . . 2158.1 WebSphere J2EE Connector Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2178.2 Solution design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218viConnecting Enterprise Applications to WebSphere Enterprise Service Bus

8.3 Mediation module design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2198.3.1 Application-specific DFHCOMMAREA business object . . . . . . . . . 2218.3.2 Generic customer business object . . . . . . . . . . . . . . . . . . . . . . . . . 2258.4 CICS interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2288.5 Mediation module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2318.5.1 Mediation implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2328.5.2 Configure the mediation module project . . . . . . . . . . . . . . . . . . . . . 2458.5.3 Generate Export: Web service binding . . . . . . . . . . . . . . . . . . . . . . 2468.5.4 Generate import: CICS MQ binding . . . . . . . . . . . . . . . . . . . . . . . . 2488.6 Add a MQCIH header to an MQ message . . . . . . . . . . . . . . . . . . . . . . . 2608.6.1 Add the MQCIH header to the MQ message . . . . . . . . . . . . . . . . . 2618.6.2 Custom MQ header data binding implementation . . . . . . . . . . . . . . 2718.6.3 Custom MQ Header Data Binding configuration . . . . . . . . . . . . . . . 2838.7 Test the mediation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2848.8 Conclusion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297Chapter 9. Code-free CICS integration using WebSphere MQ . . . . . . . . 2999.1 Why use WebSphere MQ-CICS Bridge Plug-in . . . . . . . . . . . . . . . . . . . 3019.1.1 Time savings you can expect from using the tool . . . . . . . . . . . . . . 3029.2 WebSphere MQ-CICS Bridge Plug-in . . . . . . . . . . . . . . . . . . . . . . . . . . . 3039.3 Put into context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3049.4 Task 1 - create mediation module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3069.5 Task 2 - define business objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3069.5.1 Define CICS-specific business object . . . . . . . . . . . . . . . . . . . . . . . 3079.5.2 Define generic business object . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3089.6 Task 3 - create interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3089.7 Task 4 - generate data binding class . . . . . . . . . . . . . . . . . . . . . . . . . . . 3099.8 Task 5 - configure assembly diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . 3119.8.1 Create assembly diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3119.8.2 Create XSLT transformation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3159.9 Task 6 - add WebSphere MQ header information. . . . . . . . . . . . . . . . . . 3179.9.1 Add required resources to module . . . . . . . . . . . . . . . . . . . . . . . . . 3189.9.2 Configure MQImport with MQCIH header binding class . . . . . . . . . 3209.9.3 For the case without MQCIH header. . . . . . . . . . . . . . . . . . . . . . . . 3229.9.4 For the case of with MQCIH header . . . . . . . . . . . . . . . . . . . . . . . . 3259.10 Developing an Eclipse plug-in . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3279.10.1 Extension points used for mediation primitive . . . . . . . . . . . . . . . . 3299.10.2 Extension point used for data binding menu . . . . . . . . . . . . . . . . . 3309.10.3 Extension point used for cheat sheet . . . . . . . . . . . . . . . . . . . . . . 3319.11 Conclusion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332Chapter 10. Custom application integration using JMS . . . . . . . . . . . . . 33310.1 Solution design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334Contentsvii

10.1.1 Service component design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33510.2 Create PurchaseOrder JMS client. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33610.3 Create spare parts server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34610.3.1 Expose spare parts as a Web service. . . . . . . . . . . . . . . . . . . . . . 35210.3.2 Test the Web service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35410.4 Define WebSphere ESB server resources . . . . . . . . . . . . . . . . . . . . . . 35610.4.1 Create the input and output bus destination queues. . . . . . . . . . . 35710.4.2 Create JMS queue destinations . . . . . . . . . . . . . . . . . . . . . . . . . . 36010.4.3 Create the JMS QueueConnectionFactory . . . . . . . . . . . . . . . . . . 36310.4.4 Create the JMS activation specification . . . . . . . . . . . . . . . . . . . . 36410.5 Build the mediation module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36510.5.1 Create the mediation module . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36610.5.2 Import the PartsPrice service . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36710.5.3 Import the PartRequest data type . . . . . . . . . . . . . . . . . . . . . . . . . 36710.5.4 Create PartsRequest interface . . . . . . . . . . . . . . . . . . . . . . . . . . . 36710.5.5 Add the PartsRequest interface to PurchaseOrderMediation . . . . 36810.5.6 Creating a JMS Export binding . . . . . . . . . . . . . . . . . . . . . . . . . . . 36910.5.7 Complete the component wiring . . . . . . . . . . . . . . . . . . . . . . . . . . 37110.5.8 Create the mediation flows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37210.5.9 Create the style sheet transformations . . . . . . . . . . . . . . . . . . . . . 37310.6 Test the solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37310.6.1 Unit test the Web service and mediation. . . . . . . . . . . . . . . . . . . . 37410.6.2 Test using the JSP and JMS message binding. . . . . . . . . . . . . . . 37610.6.3 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378Chapter 11. Event-driven integration using a JDBC adapter . . . . . . . . . 37911.1 Overview of the development environment . . . . . . . . . . . . . . . . . . . . . . 38011.2 Prepare the development environment . . . . . . . . . . . . . . . . . . . . . . . . . 38211.2.1 Software prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38211.2.2 Set up the development environment . . . . . . . . . . . . . . . . . . . . . . 38211.2.3 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38511.3 Create the ATT database and fraud table . . . . . . . . . . . . . . . . . . . . . . . 38611.3.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39011.4 Import metadata from the database . . . . . . . . . . . . . . . . . . . . . . . . . . . 39011.4.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39911.5 Configure the mediation module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39911.5.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40411.6 Test the application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40511.6.1 Configure the J2C Authentication Alias. . . . . . . . . . . . . . . . . . . . . 40511.6.2 Deploy to WebSphere Enterprise Service Bus . . . . . . . . . . . . . . . 40811.6.3 Test the solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41011.7 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414viiiConnecting Enterprise Applications to WebSphere Enterprise Service Bus

Chapter 12. Lightweight Web client integration using http . . . . . . . . . . . 41512.1 Auto company business scenario revisited . . . . . . . . . . . . . . . . . . . . . . 41712.1.1 Exposing SOAP to JSON RPC clients - inbound scenario . . . . . . 41712.2 Architecture patterns revisited . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41812.3 Implementing inbound communication . . . . . . . . . . . . . . . . . . . . . . . . . 41812.3.1 Architecture pattern. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41912.3.2 Web module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42012.3.3 Solution outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42112.4 Create the mediation module project . . . . . . . . . . . . . . . . . . . . . . . . . . 42212.4.1 Import interfaces and data types. . . . . . . . . . . . . . . . . . . . . . . . . . 42312.4.2 Create the imports. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42512.4.3 Create the ITSOAutoInterface. . . . . . . . . . . . . . . . . . . . . . . . . . . . 42612.4.4 Create the standalone reference. . . . . . . . . . . . . . . . . . . . . . . . . . 42912.5 Implement ITSOAutoMediationFlowComponent . . . . . . . . . . . . . . . . . . 43012.5.1 Request flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43212.5.2 Response flow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43612.6 Import the Web Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44312.6.1 Add the .war project as a dependency . . . . . . . . . . . . . . . . . . . . . 44612.6.2 Browse the Web deployment descriptor file (web.xml) . . . . . . . . . 44812.6.3 Browse the code in the JSP page . . . . . . . . . . . . . . . . . . . . . . . . . 44912.7 Create the InBoundAdapter class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45012.8 Deploy and test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45312.8.1 Import the Web services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45412.8.2 Create a test server and deploy the applications . . . . . . . . . . . . . 45512.9 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463Chapter 13. Lightweight Web service integration using http . . . . . . . . . 46513.1 Auto company business scenario revisited . . . . . . . . . . . . . . . . . . . . . . 46613.2 Implementing outbound communication . . . . . . . . . . . . . . . . . . . . . . . . 46713.2.1 Architecture pattern. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46813.2.2 Solution outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46913.3 Add getSpareParts to ITSOAutoInterface . . . . . . . . . . . . . . . . . . . . . . . 47013.3.1 Rewire the standalone reference to pick up the new operation . . 47113.3.2 Create the Java SparePartsOutbound Adapter component . . . . . 47213.4 Generate SparePartsOutBoundAdapter implementation . . . . . . . . . . . 47413.4.1 Write the code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47513.4.2 Adding JSON library (json.jar) to the build path . . . . . . . . . . . . . . 47813.5 Create the getSpareParts mediation flow . . . . . . . . . . . . . . . . . . . . . . . 47913.5.1 Create request and response flows for getSpareParts . . . . . . . . 48013.6 Add getSpareParts to the InBoundAdapter class . . . . . . . . . . . . . . . . . 48613.7 Deployment and testing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48713.7.1 Import the third-party Spare Parts Service . . . . . . . . . . . . . . . . . . 48713.7.2 Deploy third-party spare parts service on the test server . . . . . . . 489Contentsix

13.8 Test third-party spare parts service. . . . . . . . . . . . . . . . . . . . . . . . . . . . 49013.8.1 Check the message log. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49313.9 Troubleshooting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49413.10 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494Chapter 14. Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495Part 4. Appendixes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497Appendix A. Additional material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499Locating the Web material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499Using the Web material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499System requirements for downloading the Web material . . . . . . . . . . . . . 500How to use the Web material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500Appendix B. Source listings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501Chapter 12, “Lightweight Web client integration using http” on page 415 . . . 502WSDL and XSD definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502InBoundAdapter.java. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507Chapter 10,

Service Bus Peter Swithinbank Srinivas Bandaru Graham Crooks Andrew Ferrier Jenny He Raghunath Krishnaswamy Vijay Mann Muriel Viale Patterns with worked examples for many integration scenarios Code-free connection to CICS using WebSphere MQ Integrate Web 2.0 into the service bus Front cover.