Extending the Web Service Aggregation sample

You can extend the sample in the following ways.

The sample calls a single target web service, implemented in the sample as the WSAggregationTargetWS message flow.

Dynamically route to a target web service

You can dynamically override some WSDL settings in a SOAPAsyncRequest node by using the local environment. For information about what you can modify, and how to modify it, see Local environment overrides for the SOAPRequest node in the WebSphere Message Broker documentation.

You cannot dynamically override the WSDL file that is used by the SOAPAsyncRequest node.

In this sample, the WSAggregationMQtoSOAP.msgflow message flow contains SOAPAsyncRequest nodes. To override their settings, set appropriate local environment values in the ESQL for the Compute nodes in this message flow.

If you amend the name of the target web service, it is likely that the request and response messages are different to those supplied in this sample. Check every message flow to determine whether the messages that are being read or written match the new target web service.

Use an alternative target web service

To call a different single target web service, complete the following steps:

  1. Add the WSDL file for the alternative web service to a message set project.
  2. Create a deployable WSDL file for the alternative web service.
  3. In the WSAggregationFanOut.msgflow message flow, amend the ESQL in the Compute node to generate a suitable message to send to the alternative web service.
  4. Change the WSAggregationMQtoSOAP.msgflow message flow by completing the following steps:
    1. Amend the SOAPAsyncRequest nodes to use the WSDL file for the alternative web service.
    2. Set an appropriate web service URL in the SOAPAsyncRequest nodes.
  5. Implement the target web service.
  6. Change the WSAggregationSOAPtoMQ.msgflow message flow to process the alternative web service response.
  7. Change the WSAggregationFanIn.msgflow message flow to amalgamate results from the alternative web service responses.

If the target web service is in the WSDL file of the SOAPAsyncRequest node, you can override the settings dynamically as described previously.

Use two different target web services

To call two discrete target web services, complete the following steps:

  1. Add the WSDL files for the two web services to a message set project.
  2. Create deployable WSDL files for the two web services.
  3. In the WSAggregationFanOut.msgflow message flow, amend the ESQL in the Compute node to generate suitable messages to send to the two web services.
  4. Change the WSAggregationMQtoSOAP.msgflow message flow by completing the following steps:
    1. Amend one of the SOAPAsyncRequest nodes to use the WSDL file for the first web service.
    2. Amend the other SOAPAsyncRequest node to use the WSDL file for the second web service.
    3. Set appropriate web service URLs in each SOAPAsyncRequest node.
  5. Implement the target web services.
  6. Change the WSAggregationSOAPtoMQ.msgflow message flow to process the two web service responses.
  7. Change the WSAggregationFanIn.msgflow message flow to amalgamate the results from the two web service responses.

If the target web services are in one of the SOAPAsyncRequest node WSDL files, you can override the settings dynamically as described previously.

Use more than two different target web services

You can call more than two discrete target web services in a number of ways, such as in the following example.

  1. Add extra nodes to route to additional target web services.
    1. Add the WSDL files for all web services to a message set project.
    2. Create deployable WSDL files for all web services.
    3. In the WSAggregationFanOut.msgflow message flow, add and configure extra MQOutput nodes and AggregateRequest nodes.
    4. In the WSAggregationMQtoSOAP.msgflow message flow, add and configure extra MQInput, Compute, and SOAPAsyncRequest nodes.
    5. Implement the target web services.
    6. Change the WSAggregationSOAPtoMQ.msgflow message flow to process all web service responses.
    7. Change the WSAggregationFanIn.msgflow message flow to amalgamate results from all web service responses.
  2. Dynamically route to additional target web services.
    1. Add the WSDL files for all web services to a message set project.
    2. Create deployable WSDL files for all web services.
    3. In the WSAggregationMQtoSOAP.msgflow message flow, configure SOAPAsyncRequest nodes for each WSDL file.
    4. In the WSAggregationMQtoSOAP.msgflow message flow, amend the ESQL in the Compute node to set web service parameters dynamically by using local environment settings.
    5. Implement the target web services.
    6. Change the WSAggregationSOAPtoMQ.msgflow message flow to process all web service responses.
    7. Change the WSAggregationFanIn.msgflow message flow to amalgamate results from all web service responses.

Back to About the Web Service Aggregation sample

Back to sample home