0911 Boruwa1 PDF

Embed Size (px)

Citation preview

  • 8/7/2019 0911 Boruwa1 PDF

    1/24

    Developing a WebSphere Commerce Get Webservice mediation in WebSphere EnterpriseService Bus, Part 1Skill Level: Intermediate

    Asim Boruwa ([email protected])Software EngineerIBM

    18 Nov 2009

    Part 1 of this 2-part tutorial series provides a series of tasks to help you develop abasic mediation of an IBM WebSphere Commerce Web service in IBMWebSphere Enterprise Service Bus.

    Section 1. Before you start

    Following service-oriented architecture (SOA), WebSphere Commerce uses Webservices as the medium to integrate with backend systems like ERP, CRM, Yantra,or DOM. WebSphere Commerce has a Web services framework that has differentbusiness components containing both inbound and outbound Web services. Thistutorial uses WebSphere Enterprise Service Bus (hereafter called WebSphere ESB)as the middleware for mediating outbound messages from WebSphere Commerceto a backend system.

    In this tutorial, you will learn the basic tasks required to develop a mediation module

    for mediating messages from WebSphere Commerce to a backend system.WebSphere Commerce typically contains four Web services patterns: Get, Process,Sync, and Change. Part 1 will help you build mediation modules for Web servicespatterns Process, Sync, and Change. However, to develop a mediation module for aWeb service Get pattern, certain additional tasks are required to perform, which arediscussed in Part 2. If you have already used WebSphere ESB for mediation, thenyou may skip Part 1 and go to Part 2.

    Developing a WebSphere Commerce Get Web service mediation in WebSphere Enterprise Service Bus, Part 1 Copyright IBM Corporation 2009. All rights reserved. Page 1 of 24

    mailto:[email protected]://developerworks/websphere/tutorials/0911_boruwa2/http://developerworks/websphere/tutorials/0911_boruwa2/http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtmlhttp://developerworks/websphere/tutorials/0911_boruwa2/http://developerworks/websphere/tutorials/0911_boruwa2/mailto:[email protected]
  • 8/7/2019 0911 Boruwa1 PDF

    2/24

    Objectives

    Learn how to:

    Create reusable libraries using resources from WebSphere Commerceand a backend system in WebSphere ESB.

    Log data objects using the message logger to audit a message flow.

    Use the XSL transformation and business object map to transform abusiness object.

    Prerequisites

    You need to be familiar with the basic concepts of SOA and Web services. You also

    need to be familiar with the use of WebSphere Integration Developer as theIntegrated Development Environment for the development of applications that run onWebSphere ESB.

    System requirements

    To follow the examples in this tutorial, you need WebSphere Commerce V6.0 withFeature Pack 5 and WebSphere Integration Developer V6.1.2 with a Test EnterpriseService Bus V6.1 server profile.

    Duration

    3 hours

    Section 2. Introduction

    WebSphere Commerce remains consistent in the message format for both theinbound and outbound Web services that it has to offer. It uses the OAGIS standardfor the messages. A middleware like WebSphere ESB is used to mediate messagesfrom WebSphere Commerce to backend system and vice-versa. In this tutorial, youwill use a proxy backend system that provides inbound Web services interfaces forintegration. In Part 1, you will learn how to create a basic mediation module inWebSphere ESB, importing the required assets from WebSphere Commerce and

    developerWorks ibm.com/developerWorks

    Developing a WebSphere Commerce Get Web service mediation in WebSphere Enterprise Service Bus, Part 1Page 2 of 24 Copyright IBM Corporation 2009. All rights reserved.

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/7/2019 0911 Boruwa1 PDF

    3/24

    the backend system.

    The tasks required for mediating WebSphere Commerce Web services patternsProcess, Sync, and Change are similar to what you will see in Part 1. Theparameters in the Web service request for these three patterns are set in the

    business object itself in the form of properties and attributes. Hence, messagetransformation usually involves assigning the value of the property or attribute fromthe business object in the WebSphere Commerce interface to the equivalentproperty or attribute in the backend interface.

    Since the main objective of this tutorial is to explain mediating Get services, we willuse an outbound GetInventoryAvailability service as an example through out thistutorial. You will learn the tasks required to develop the basic mediation ofGetInventoryAvailability, which is common for all four patterns. In Part 2, you willlearn the additional tasks specific for a Get pattern that are required to develop themediation of GetInventoryAvailability.

    You will use a proxy backend system named "MyBackend", which contains anInventory service that has its own message format. SOAP/HTTP will be used as thetransport for the Web services in this tutorial.

    Section 3. Setting up the environment

    In the following sections, you will learn how to set up your development environmentfor developing the mediation module in WebSphere Integration Developer.

    Installing the proxy backend

    The proxy backend MyBackend is provided as an EAR file, MyBackend.ear, in theDownload section.

    1. Login to the WebSphere ESB admin console of your test WebSphereESB server and install MyBackend.ear. The MyBackend application hasbeen kept simple and it does not need any additional configuration. Leaveall the options to default and finish the installation.

    2. Make sure you save the settings to the Master Configuration so that youdo not have to install MyBackend.ear every time.

    3. The newly installed applications do not start automatically so you need to

    ibm.com/developerWorks developerWorks

    Developing a WebSphere Commerce Get Web service mediation in WebSphere Enterprise Service Bus, Part 1 Copyright IBM Corporation 2009. All rights reserved. Page 3 of 24

    http://developerworks/websphere/tutorials/0911_boruwa2/http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtmlhttp://developerworks/websphere/tutorials/0911_boruwa2/
  • 8/7/2019 0911 Boruwa1 PDF

    4/24

    manually start the application.

    Verifying the installation of MyBackend

    1. The default URL to the Inventory service in MyBackend ishttp://localhost:9081/MyBackend/InventoryService. Sinceyou have not overridden the default configuration during installation, theWeb module of MyBackend gets bound to the default virtual host,default_host.

    2. Check the port numbers under the host aliases of default_host by loggingin to the WebSphere ESB admin console. By default, it has port 9081,which is used for inbound Web service requests.

    3. Replace the port number in the default Inventory service URL andexecute the URL from a browser.

    4. If you get a response like "Hi there, this is a Web service!",then it means that the Inventory Web Service is running.

    Testing the Inventory service in MyBackend

    1. Use a test utility, like Web Services Explorer, available inWebSphere Integration Developer to post the SOAP request to theInventory service using the URLhttp://localhost:9081/MyBackend/InventoryService. The

    sample zip file Sample_Messages_Part_1.zip contains a sample SOAPrequest CheckMaterialAvailability.xml and a sample SOAPresponse ShowMaterialAvailability.xml.

    2. Verify that you get the sample response for the sample request.

    Creating the libraries

    Creating libraries with the specific resources from WebSphere Commerce andbackend are necessary. A single library can be shared by multiple mediation

    modules. It is easier to organize and maintain the end-systems specific resources ina library. You can create a new library from File -> New -> Library. In this tutorial,you are dealing with two end-systems - WebSphere Commerce and MyBackend.The following sections will demonstrate how you can create libraries containing thespecific resources from WebSphere Commerce and MyBackend.

    Creating the MyBackend library - MyBackend-Lib

    developerWorks ibm.com/developerWorks

    Developing a WebSphere Commerce Get Web service mediation in WebSphere Enterprise Service Bus, Part 1Page 4 of 24 Copyright IBM Corporation 2009. All rights reserved.

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/7/2019 0911 Boruwa1 PDF

    5/24

    To follow the scenarios in this tutorial, the only resource required from MyBackend isthe WSDL file for the Inventory service in MyBackend.

    1. Create a New Library in your workspace and name it MyBackend-Lib.The WSDL for MyBackend is provided in MyBackend-WSDL.zip.

    2. Extract the contents of MyBackend-WSDL.zip into a temporary folderand from the temporary folder. Import the WSDL to MyBackend-Lib usingthe WSDL/Interface Import wizard.

    Creating the WebSphere Commerce library - WC-Lib

    You require only the WSDL for the Inventory service in WebSphere Commerce.

    1. Create a new library in your workspace and name it WC-Lib, where WC

    stands for WebSphere Commerce.

    2. You need to import the WSDL from the Web moduleWebServicesRouter in WebSphere Commerce Server. TheWebServicesRouter Web module is found in the WC_eardir directoryin a WebSphere Commerce Server, where as an example, WC_eardirstands forC:\Websphere\AppServer\profiles\demo\installedApps\WC_demo_cel

    3. Using the WSDL/Interface Import wizard, import the WSDLInventoryServices.wsdl from the

    WC_eardir\WebServicesRouter.war\component-services\wsdlfolder into WC-Lib.

    Section 4. Developing the mediation module

    1. Create a new mediation module from File -> New -> Mediation Module

    and enter the details as shown in Figure 1.Figure 1. Creating a mediation module

    ibm.com/developerWorks developerWorks

    Developing a WebSphere Commerce Get Web service mediation in WebSphere Enterprise Service Bus, Part 1 Copyright IBM Corporation 2009. All rights reserved. Page 5 of 24

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/7/2019 0911 Boruwa1 PDF

    6/24

    2. Click Next and select the libraries as shown in Figure 2.Figure 2. Selecting the required libraries

    developerWorks ibm.com/developerWorks

    Developing a WebSphere Commerce Get Web service mediation in WebSphere Enterprise Service Bus, Part 1Page 6 of 24 Copyright IBM Corporation 2009. All rights reserved.

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/7/2019 0911 Boruwa1 PDF

    7/24

    3. Click Finish. At this point, a new mediation module named Basic iscreated and the Assembly Diagram opens automatically in the AssemblyEditor. This contains a mediation flow component called"BasicMediationImpl".

    Mediation module assembly

    Now you have a mediation module containing only a mediation flow component,BasicMediationImpl. The mediation flow component is useless without an exportcomponent, as otherwise it cannot be executed by any external request. An importcomponent is required so that the mediation flow can invoke the Inventory service inMyBackend. The following sections will demonstrate how you can define an exportand an import component in the mediation module.

    Defining the export component

    ibm.com/developerWorks developerWorks

    Developing a WebSphere Commerce Get Web service mediation in WebSphere Enterprise Service Bus, Part 1 Copyright IBM Corporation 2009. All rights reserved. Page 7 of 24

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/7/2019 0911 Boruwa1 PDF

    8/24

    1. Select Export from the palette and drop it into the assembly diagram.

    2. Edit the name, for example, WC_InventoryServiceExport, to make itmore meaningful.

    3. Right-click the export component and select Add Interface and choosethe Inventory interface of WebSphere Commerce as shown in Figure 3.Figure 3. Choosing an interface

    4. Right-click the export component and select Generate Binding... -> WebService Binding.

    5. In the Transport Selection pop-up window, select soap/http as shown in

    developerWorks ibm.com/developerWorks

    Developing a WebSphere Commerce Get Web service mediation in WebSphere Enterprise Service Bus, Part 1Page 8 of 24 Copyright IBM Corporation 2009. All rights reserved.

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/7/2019 0911 Boruwa1 PDF

    9/24

    Figure 4 and click OK.Figure 4. Choosing the Web service transport

    6. Save the Assembly diagram. Make sure that Build Automatically isselected.

    The default URL generated for the export component is

    http://localhost:9080/BasicWeb/sca/WC_InventoryServiceExport.Here, BasicWeb is the context root of the Web module of Basic mediation moduleand sca/WC_InventoryServiceExport is the relative URL. The default URL isdifficult to remember. Hence, to simplify the URL, do the following:

    1. Right-click the export component and select Show in Properties.

    2. In the Properties tab, click the Binding tab.

    3. Click the Configure button. The Module Deployment Editor opens.

    4. Click the Exports tab.

    5. Expand Context Root and edit the Context root to something easier toremember, for example, Basic.

    6. In the Export Specific Settings section, selectWC_InventoryServiceExport in the list of Web Service Exports.

    ibm.com/developerWorks developerWorks

    Developing a WebSphere Commerce Get Web service mediation in WebSphere Enterprise Service Bus, Part 1 Copyright IBM Corporation 2009. All rights reserved. Page 9 of 24

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/7/2019 0911 Boruwa1 PDF

    10/24

    7. Expand the URL Mappings section and click Add.

    8. Add a new URL pattern, for example, /InventoryService, as shown inFigure 5.Figure 5. Export Configuration options

    9. Uncheck the Include default mapping checkbox.

    10. Save the changes.

    11. After the above changes, the URL to WC_InventoryServiceExportbecomes http://localhost:9080/Basic/InventoryService.

    12. Now, add the wire from WC_InventoryServiceExport toBasicMediationImpl. If there is a confirmation pop-up similar to Figure 6,click OK. Save the changes in the Assembly Diagram.Figure 6. Add wire confirmation

    developerWorks ibm.com/developerWorks

    Developing a WebSphere Commerce Get Web service mediation in WebSphere Enterprise Service Bus, Part 1Page 10 of 24 Copyright IBM Corporation 2009. All rights reserved.

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/7/2019 0911 Boruwa1 PDF

    11/24

    Defining the import component

    1. Select Import from the palette and drop it into the assembly diagram.

    2. Edit the name, for example, MyBackend_InventoryServiceImport,to make it more meaningful.

    3. Right-click the import component and select Add Interface and choosethe Inventory interface of MyBackend as shown in Figure 7.Figure 7. Choosing an interface

    ibm.com/developerWorks developerWorks

    Developing a WebSphere Commerce Get Web service mediation in WebSphere Enterprise Service Bus, Part 1 Copyright IBM Corporation 2009. All rights reserved. Page 11 of 24

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/7/2019 0911 Boruwa1 PDF

    12/24

    4. Right-click the import component and select Generate Binding... -> WebService Binding.

    5. Select Use an existing web service port and click Browse.

    6. Select the Web service port of the MyBackend/InventoryService asshown in Figure 8 and click OK.Figure 8. Choosing the Web service port

    developerWorks ibm.com/developerWorks

    Developing a WebSphere Commerce Get Web service mediation in WebSphere Enterprise Service Bus, Part 1Page 12 of 24 Copyright IBM Corporation 2009. All rights reserved.

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/7/2019 0911 Boruwa1 PDF

    13/24

    7. Add the wire from BasicMediationImpl toMyBackend_InventoryServiceImport and click OK if you get aconfirmation as shown in Figure 9.Figure 9. Add wire confirmation

    ibm.com/developerWorks developerWorks

    Developing a WebSphere Commerce Get Web service mediation in WebSphere Enterprise Service Bus, Part 1 Copyright IBM Corporation 2009. All rights reserved. Page 13 of 24

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/7/2019 0911 Boruwa1 PDF

    14/24

    8. Save the changes in the Assembly Diagram.

    9. After completing Step 6, the import component is bound to the defaultURL mentioned in the Web service port of MyBackend Inventory service

    WSDL, which ishttp://localhost:9081/MyBackend/InventoryService. Ifrequired, modify the URL in the properties ofMyBackend_InventoryServiceImport after resolving the URL of theMyBackend Inventory service by performing the tasks mentioned inVerifying the installation of MyBackend.

    Mediation flow

    The export component and import component will take care of the Web Service

    invocation to and from the mediation flow. The mediation flow contains theimplementation of the mediation logic between the interfaces. A mediation flowcontains the mediation logic for multiple operation connections. To create themediation flow implementation, do the following:

    1. Double-click BasicMediationImpl from the Assembly Diagram and clickOK if you get a confirmation as shown in Figure 10.Figure 10. Mediation flow confirmation

    developerWorks ibm.com/developerWorks

    Developing a WebSphere Commerce Get Web service mediation in WebSphere Enterprise Service Bus, Part 1Page 14 of 24 Copyright IBM Corporation 2009. All rights reserved.

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/7/2019 0911 Boruwa1 PDF

    15/24

    2. In the Generate Implementation pop-up window, click New Folder andenter a folder name, such as MediationImpl, and click OK. This willplace the mediation flow implementation files inside the sub-folderMediationImpl for better file structure of the mediation module.

    3. Click OK. The mediation flow editor opens.

    4. Go back to Assembly Diagram and save the changes and close theAssembly Diagram.

    Connecting the operations

    Each operation connection in a mediation flow implementation contains themediation logic for a certain scenario. The interfaces that you see on the left-handside are the interfaces that the Export components in the mediation module support.The interfaces that you see on the right-hand side are the references to the

    interfaces that the import components in the mediation module support. Each exportinterface can refer to multiple import interface references. However, for the sake ofsimplicity, only a single operation connection betweenGetInventoryAvailability and CheckMaterialAvailability will be usedin this tutorial. To connect the operations do the following:

    1. Click the GetInventoryAvailability operation and add the wire toCheckMaterialAvailability as shown in Figure 11.Figure 11. Connecting operations

    2. Save the changes.

    Implementing the mediation flow

    In this section, you will learn how to implement the mediation flow for the operationconnection that you have made between GetInventoryAvailability andCheckMaterialAvailability. Click the wire so that the request and responseflows for the operation connection are displayed on the lower half of the mediation

    ibm.com/developerWorks developerWorks

    Developing a WebSphere Commerce Get Web service mediation in WebSphere Enterprise Service Bus, Part 1 Copyright IBM Corporation 2009. All rights reserved. Page 15 of 24

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/7/2019 0911 Boruwa1 PDF

    16/24

    flow editor as shown in Figure 12.

    Figure 12. Implementing the request and the response flow

    To transform GetInventoryAvailability to CheckMaterialAvailability,

    you need to use the XSL transformation mediation primitive. Do the following:

    1. Click the Transformation tab on the palette.

    2. Select XSL Transformation and drop it into the Request flow.

    3. Edit the name to a meaningful one, for example,GetInventoryAvailabilityXSLT.

    4. Click Input and wire its output terminal to the input terminal ofGetInventoryAvailabilityXSLT, and the output terminal of

    GetInventoryAvailabilityXSLT to the input terminal of callout as shown inFigure 13.Figure 13. Wiring the components

    5. Save the changes.

    The XSL transformation component has been added in the flow. However, you needto implement the mapping between the two business objects in the XSL

    developerWorks ibm.com/developerWorks

    Developing a WebSphere Commerce Get Web service mediation in WebSphere Enterprise Service Bus, Part 1Page 16 of 24 Copyright IBM Corporation 2009. All rights reserved.

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/7/2019 0911 Boruwa1 PDF

    17/24

    transformation component. Do the following to create the map:

    1. Double-click GetInventoryAvailabilityXSLT, which opens the wizard tocreate a new XML Mapping.

    2. Enter the details as shown in Figure 14.Figure 14. Creating a new XML map

    3. Specify the message types. Since you have already connected the inputand output terminals of the XSL transformation component, itautomatically resolves the message types as shown in Figure 15.Figure 15. Specifying the message types

    ibm.com/developerWorks developerWorks

    Developing a WebSphere Commerce Get Web service mediation in WebSphere Enterprise Service Bus, Part 1 Copyright IBM Corporation 2009. All rights reserved. Page 17 of 24

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/7/2019 0911 Boruwa1 PDF

    18/24

    4. Click Finish. It opens the GetInventoryAvailabilityXSLT map in theMapping Editor.

    5. Go back to the mediation flow editor and save the changes.

    To map the business objects in GetInventoryAvailabilityXSLT map do the following:

    1. Open the GetInventoryAvailabilityXSLT map.

    2. The CheckMaterialAvailability request requires only two properties,MaterialNumber and FullfillmentCenter. In Part 2 of the tutorial, you willlearn how to parse the XPath from GetInventoryAvailability and map theparameters to CheckMaterialAvailability. In Part 1, hard code theproperties MaterialNumber and FullfillmentCenter so that a request canpass through. Right-click the property and select Create Transform,

    developerWorks ibm.com/developerWorks

    Developing a WebSphere Commerce Get Web service mediation in WebSphere Enterprise Service Bus, Part 1Page 18 of 24 Copyright IBM Corporation 2009. All rights reserved.

    http://developerworks/websphere/tutorials/0911_boruwa2/http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtmlhttp://developerworks/websphere/tutorials/0911_boruwa2/
  • 8/7/2019 0911 Boruwa1 PDF

    19/24

    which displays the properties of the transform assign. Hard code a value,for example, MSCFF39B for MaterialNumber and FF01 forFullfillmentCenter as shown in Figure 16.Figure 16. Setting the value in assign transform

    3. Since you are hard coding the request for only one material, specify thearray indices for the assign transforms from the Cardinality tab underProperties of the transform. Set the index of MaterialAvailability andMaterialNumber as 1 as shown in Figure 17.

    Figure 17. Setting the output array indices

    4. Save the changes.

    5. You can use the Test Map utility to test your XML map without deploying

    the mediation module. It helps you to narrow down a problem that mightoccur in the mediation module. You can provide a sample input XMLcontaining the body and run the tool, which will display the resultant XMLoutput on the right-hand side.

    6. The tasks required to implement the response flow is similar to what youhave just learned for the request flow. In the response flow, you need towire the output terminal of the callout response to the input terminal of theXSL transformation component. The output terminal of the XSLtransformation component is connected to the input terminal of inputresponse as shown in Figure 18.

    Figure 18. Response flow

    ibm.com/developerWorks developerWorks

    Developing a WebSphere Commerce Get Web service mediation in WebSphere Enterprise Service Bus, Part 1 Copyright IBM Corporation 2009. All rights reserved. Page 19 of 24

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/7/2019 0911 Boruwa1 PDF

    20/24

    7. The Download section contains a sample mediation moduleimplementation in BasicMediation_PI.zip. TheShowInventoryAvailabilityXSLT map in the sample code makes use ofother XSL transforms like "For Each" and "Move". For Each and Move are

    some of the primitive XSL transforms. Refer to the online Help inWebSphere Integration Developer to learn more about the supportedtransform types.

    8. Import BasicMediation_PI.zip into your workspace using the ProjectInterchange import wizard. The mediation module Basic containsreferences to the libraries MyBackend-Lib and WC-Lib, which are notincluded in the project interchange zip. You need to first create thelibraries as mentioned in the sections above and then import the projectinterchange in your workspace.

    Auditing the business objects using message logger

    A business object passes through different components in a mediation flow. Since itundergoes transformation, for debugging and auditing purposes, you can use themessage logger primitive component in the mediation flow. For instance, you canuse message logger to log the input and output business object of an XSLtransformation. On execution of every flow, the business objects will be logged to thedatabase. You can view the business objects in the message logs by querying thedatabase.

    The message logger has two transaction modes - "Same" and "New". If you use theSame transaction mode, then messages are logged using the same transaction of

    the message flow. This means that if an error occurs in the flow, logs will not becommitted to database. If you use the New transaction mode, then a new transactionis created for the message logger and the logs will be committed using the newtransaction. For debugging purposes, you can use the New transaction mode toidentify the cause of the error in the flow.

    The sample code already contains message loggers in the flows as shown in Figure19.

    Figure 19. Message loggers in mediation flow

    developerWorks ibm.com/developerWorks

    Developing a WebSphere Commerce Get Web service mediation in WebSphere Enterprise Service Bus, Part 1Page 20 of 24 Copyright IBM Corporation 2009. All rights reserved.

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/7/2019 0911 Boruwa1 PDF

    21/24

    The Download section contains an EAR application, DBAccessApp.ear.DBAccessApp provides a simple Web interface to query your database. Using thisapplication, you can query your database to view the business objects logged by themessage logger in the flows. Tasks required to deploy DBAccessApp are similar towhat is mentioned in the sections Installing the proxy backend and Verifying the

    installation of MyBackend. The default URL to launch the database query page ishttp://localhost:9081/db/access.

    Section 5. Testing the mediation module

    Tasks required to test the mediation module are similar to what is mentioned in thesections Verifying the installation of MyBackend and Testing the Inventory service in

    MyBackend.

    1. You need to post the SOAP request GetInventoryAvailability tothe URL of the export component of the mediation module, which ishttp://localhost:9081/Basic/InventoryService.Sample_Messages_Part_1.zip provided in the Download section containsa sample SOAP request, GetInventoryAvailability.xml, and asample SOAP response, ShowInventoryAvailability.xml.

    2. Verify that you get the sample response for the sample request.

    3. After receiving the response, you can launch DBAccessApp using theURL http://localhost:9081/db/access and view the businessobjects that are logged at various stages in the mediation flow.

    Section 6. Securing the mediation module

    You can implement basic authentication by following the instructions given inImplementing authentication in the WebSphere Integration Developer InformationCenter.

    To secure the messages at the transport layer, you can use HTTPS by following theinstructions in Configuring SSL for secure outbound Web service calls fromWebSphere Commerce to WebSphere Enterprise Service Bus.

    ibm.com/developerWorks developerWorks

    Developing a WebSphere Commerce Get Web service mediation in WebSphere Enterprise Service Bus, Part 1 Copyright IBM Corporation 2009. All rights reserved. Page 21 of 24

    http://publib.boulder.ibm.com/infocenter/dmndhelp/v6rxmx/index.jsp?topic=/com.ibm.wbit.help.runtime.doc/topics/timplbasicauth.htmlhttp://www.ibm.com/developerworks/websphere/tutorials/0905_boruwa/http://www.ibm.com/developerworks/websphere/tutorials/0905_boruwa/http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/developerworks/websphere/tutorials/0905_boruwa/http://www.ibm.com/developerworks/websphere/tutorials/0905_boruwa/http://publib.boulder.ibm.com/infocenter/dmndhelp/v6rxmx/index.jsp?topic=/com.ibm.wbit.help.runtime.doc/topics/timplbasicauth.html
  • 8/7/2019 0911 Boruwa1 PDF

    22/24

    Section 7. Conclusion

    From this tutorial, you learned how to create a basic mediation module inWebSphere Integration Developer using the interfaces from WebSphere Commerceand a proxy backend system. You learned how to:

    Create libraries and use them in the mediation module.

    Create the mediation assembly.

    Connect the operations and how to implement the mediation flow.

    Audit the business objects at different stages of the mediation flow.

    Acknowledgements

    The author would like to thank Jacob Vandergoot for his help in reviewing thistutorial.

    developerWorks ibm.com/developerWorks

    Developing a WebSphere Commerce Get Web service mediation in WebSphere Enterprise Service Bus, Part 1Page 22 of 24 Copyright IBM Corporation 2009. All rights reserved.

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/7/2019 0911 Boruwa1 PDF

    23/24

    Downloads

    Description Name Size Downloadmethod

    Proxy backend files MyBackend.ear 27KB HTTPWSDL files from MyBackend MyBackend-WSDL.zip 3KB HTTP

    SOAP messages Sample_Messages_Part_1.zip 3KB HTTP

    Basic mediation module BasicMediation_PI.zip 18KB HTTP

    Database access application DBAccessApp.ear 5KB HTTP

    Information about download methods

    ibm.com/developerWorks developerWorks

    Developing a WebSphere Commerce Get Web service mediation in WebSphere Enterprise Service Bus, Part 1 Copyright IBM Corporation 2009. All rights reserved. Page 23 of 24

    http://public.dhe.ibm.com/software/dw/wes/0911_boruwa1/MyBackend.earhttp://public.dhe.ibm.com/software/dw/wes/0911_boruwa1/MyBackend-WSDL.ziphttp://public.dhe.ibm.com/software/dw/wes/0911_boruwa1/Sample_Messages_Part_1.ziphttp://public.dhe.ibm.com/software/dw/wes/0911_boruwa1/BasicMediation_PI.ziphttp://public.dhe.ibm.com/software/dw/wes/0911_boruwa1/DBAccessApp.earhttp://www.ibm.com/developerworks/library/whichmethod.htmlhttp://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/developerworks/library/whichmethod.htmlhttp://public.dhe.ibm.com/software/dw/wes/0911_boruwa1/DBAccessApp.earhttp://public.dhe.ibm.com/software/dw/wes/0911_boruwa1/BasicMediation_PI.ziphttp://public.dhe.ibm.com/software/dw/wes/0911_boruwa1/Sample_Messages_Part_1.ziphttp://public.dhe.ibm.com/software/dw/wes/0911_boruwa1/MyBackend-WSDL.ziphttp://public.dhe.ibm.com/software/dw/wes/0911_boruwa1/MyBackend.ear
  • 8/7/2019 0911 Boruwa1 PDF

    24/24

    Resources

    Learn

    Design pattern for Get service implementation

    WebSphere Commerce extended XPath notation

    Working with modules and libraries

    Creating mediation flows

    Implementing authentication

    Configuring SSL for secure outbound Web service calls from WebSphereCommerce to WebSphere ESB

    Discuss

    WebSphere Commerce discussion forum

    About the author

    Asim Boruwa

    Asim Boruwa is a Staff Software Engineer at the IBM India Software Lab inBangalore, India. He specializes in integrating WebSphere Commerce with externalsystems using IBM middleware solutions. He also specializes in providing solutionsto WebSphere Commerce customers.

    developerWorks ibm.com/developerWorks

    Developing a WebSphere Commerce Get Web service mediation in WebSphere Enterprise Service Bus, Part 1Page 24 of 24 Copyright IBM Corporation 2009. All rights reserved.

    http://publib.boulder.ibm.com/infocenter/wchelp/v6r0m0/topic/com.ibm.commerce.component-services.doc/concepts/cwvsoiget.htmhttp://publib.boulder.ibm.com/infocenter/wchelp/v6r0m0/topic/com.ibm.commerce.component-services.doc/refs/rwvxpath.htmhttp://publib.boulder.ibm.com/infocenter/dmndhelp/v6rxmx/topic/com.ibm.wbit.help.ui.doc/topics/cworksol.htmlhttp://publib.boulder.ibm.com/infocenter/dmndhelp/v6rxmx/topic/com.ibm.wbit.help.sib.mediation.ui.doc/topics/tbldmed.htmlhttp://publib.boulder.ibm.com/infocenter/dmndhelp/v6rxmx/index.jsp?topic=/com.ibm.wbit.help.runtime.doc/topics/timplbasicauth.htmlhttp://www.ibm.com/developerworks/websphere/tutorials/0905_boruwa/http://www.ibm.com/developerworks/websphere/tutorials/0905_boruwa/http://www.ibm.com/developerworks/forums/forum.jspa?forumID=284http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/developerworks/forums/forum.jspa?forumID=284http://www.ibm.com/developerworks/websphere/tutorials/0905_boruwa/http://www.ibm.com/developerworks/websphere/tutorials/0905_boruwa/http://publib.boulder.ibm.com/infocenter/dmndhelp/v6rxmx/index.jsp?topic=/com.ibm.wbit.help.runtime.doc/topics/timplbasicauth.htmlhttp://publib.boulder.ibm.com/infocenter/dmndhelp/v6rxmx/topic/com.ibm.wbit.help.sib.mediation.ui.doc/topics/tbldmed.htmlhttp://publib.boulder.ibm.com/infocenter/dmndhelp/v6rxmx/topic/com.ibm.wbit.help.ui.doc/topics/cworksol.htmlhttp://publib.boulder.ibm.com/infocenter/wchelp/v6r0m0/topic/com.ibm.commerce.component-services.doc/refs/rwvxpath.htmhttp://publib.boulder.ibm.com/infocenter/wchelp/v6r0m0/topic/com.ibm.commerce.component-services.doc/concepts/cwvsoiget.htm