Build it yourself

Prerequisites

Download the EndpointLookupSampleSkeleton.zip project interchange file and import the associated projects.

  1. In WebSphere® Integration Developer, go to File >Import >Other >Project Interchange.
  2. Browse for the downloaded EndpointLookupSampleSkeleton.zip project interchange file. Select the file. Click OK.
  3. The project panel is displayed. Click Select all to select all associated projects.

To build the Endpoint Lookup sample, complete these steps:

  1. Create and edit a mediation module.
  2. Add a WebService Export.
  3. Build the mediation flow.

Create and edit a mediation module

To create a mediation module:

  1. In WebSphere Information Developer, select File >New >Mediation module.
  2. Name the new module OrderDispatchMediation. Leave the default boxes ticked. Click Next.
  3. Select OrderDispatchLibrary. Click Finish. The assembly diagram is displayed and a new mediation component is automatically created.

To edit this mediation module:

  1. In the assembly diagram, right click the mediation flow component and select Add >Interface.
  2. Select the existing interface, OrderDispatchService. Click OK.
  3. Right click the mediation flow component again. Select Add >Reference.
  4. Select the existing interface, OrderDispatchService. Click OK.

Add a WebService export

  1. In the assembly diagram, right click the mediation flow component. Select Generate Export >Web Service Binding.
  2. Select SOAP1.1/HTTP. Click Finish.

Build the mediation flow

To generate a flow and implement the mediation:

  1. In the assembly diagram, right click the mediation flow component. Select Generate Implementation. Move the file to the default folder, OrderDispatchMediation. Click OK. The flow editor overview appears.
  2. Click dispatchOrder. Select the blank template.
  3. On the Palette, click the Callout node. Click and drag this node to any blank space in the assembly diagram.
  4. In the Reference Operation dialog, select. The default reference is DispatchServicePartner. Click OK.

To set the properties of the callout node:

  1. Click the callout node and select Retry.
  2. Set the value of Retry on to Any fault.
  3. Set the value of Retry count to10, and the value of Retry delay(seconds) to 5. Make sure Try alternate endpoint is checked.

To link the OrderDispatchService input node to the OrderDispatchServicePartner callout node:

  1. Click the out terminal, click and drag this to the callout node you have just created.
  2. On the Palette, select Routing >Endpointlookup. Click and drag Endpointlookup onto the wire that you created in Step 1.
  3. Click the name of this Endpointlookup primitive and rename it to FindServices.
  4. Click the Endpoint Lookup primitive.
  5. Go to the Properties view. Click Details.
  6. Click the Browse button and select matching interface OrderDispatchService from the list.
  7. Select from the Match Policy list:Return all matching endpoints and set alternate routing targets.
    Endpoint Lookup Properties
  8. Wire the noMatch terminal of the Endpoint Lookup primitive to the InputFault node. Ensure you select the Transform the message using an XSL Transformation Primitive box.
  9. Rename the XSLT primitive to MapFaultInfo.

Create a new map:

  1. In the MapFaultInfo primitive, go to Properties >Details >New. Leave the default values and click Next.
  2. In the Message Root list, select /. Click Finish. The Mapping editor is displayed.
  3. In the MapFaultInfoReq_1 view, map according to the following specifications:
    1. Under Source, select Context >failInfo >failureString.
    2. Click and drag the failureString item to the Target area and connect it to failureCode, which you can find under Body >DispatchOrderFault1.
    3. Under Source, select Body >DispatchOrder >input1 >orderID.
    4. Click and drag orderID to the Target area and connect to orderID under Body/DispatchOrderFault1/orderID.
  4. Click Save.
    The figure shows how the orderID under source is
  linked to orderID under Target.
  5. Connect the callout response to the input.