Creating the WebService message flows

The WSRR WebService message flows are supplied, but if you prefer to create the message flows yourself, follow the instructions below:

  1. In the Message Brokers Toolkit, switch to the Broker Application Development perspective.
  2. Create a new message flow project called WSRR Connectivity Message Flows. Add a project dependency to the WSRR Connectivity Message Set project.
    For instructions, see Creating a message flow project [TODO: FIX THIS LINK].
  3. Create a new message flow called DemoCustomer_WebService_v10.
    For instructions, see Creating a message flow. [TODO: FIX THIS LINK]
  4. In the Message Flow editor, add and rename the nodes listed in the following table.
    For instructions, see Adding a node. [TODO: FIX THIS LINK]
    Palette drawers Node type Node name
    Web Services SOAPInput SOAP DemoCustomer
    Transformation Compute Create WS Response
    Web Services SOAPReply SOAP Reply
  5. Connect the nodes together as listed in the following table.
    For instructions, see Connecting nodes. [TODO: FIX THIS LINK]
    To check that you have connected the nodes together correctly, see the figure in About the WSRR Connectivity sample.
    Node name Terminal Connect to this node
    SOAP DemoCustomer Out Create WS Response
    Create WS Response Out SOAP Reply
  6. Configure the node properties as listed in the following table. Accept the default values for all properties unless an alternative value is listed in the table.
    For instructions, see Configuring a node. [TODO: FIX THIS LINK]
    Node name Page Property Value
    SOAP DemoCustomer Basic WSDL file name Browse to the DemoCustomer_v10.wsdl file imported earlier into the WSRR Connectivity Message Set.
    Once selected, this will populate the other properties on the Basic page.
  7. Double-click the Create WS Response node to open the ESQL editor. Copy and paste the following ESQL code modules to the ESQL file. For more information, see Developing ESQL. [TODO: FIX THIS LINK]
    DECLARE tns NAMESPACE 'http://schemas.xmlsoap.org/soap/envelope/';
    DECLARE intf NAMESPACE 'http://demo.sr.eis.ibm.com';
    
    CREATE COMPUTE MODULE DemoCustomer_WebService_v10_CreateWSResponse
      CREATE FUNCTION Main() RETURNS BOOLEAN
      BEGIN
        CALL CopyMessageHeaders();
        SET OutputRoot.SOAP.Body.intf:updateCustomerResponse.updateCustomerReturn = 'Updated Customer via WebService version 1.0';
        RETURN TRUE;
      END;
      
      CREATE PROCEDURE CopyMessageHeaders() BEGIN
        DECLARE I INTEGER;
        DECLARE J INTEGER;
        SET I = 1;
        SET J = CARDINALITY(InputRoot.*[]);
        WHILE I < J DO
          SET OutputRoot.*[I] = InputRoot.*[I];
          SET I = I + 1;
        END WHILE;
      END;
    
    END MODULE;
    
    CREATE COMPUTE MODULE DemoCustomer_WebService_v20_CreateWSResponse
      CREATE FUNCTION Main() RETURNS BOOLEAN
      BEGIN
        CALL CopyMessageHeaders();
        SET OutputRoot.SOAP.Body.intf:updateCustomerResponse.updateCustomerReturn = 'Updated Customer via WebService version 2.0';
        RETURN TRUE;
      END;
    
      CREATE PROCEDURE CopyMessageHeaders() BEGIN
        DECLARE I INTEGER;
        DECLARE J INTEGER;
        SET I = 1;
        SET J = CARDINALITY(InputRoot.*[]);
        WHILE I < J DO
          SET OutputRoot.*[I] = InputRoot.*[I];
          SET I = I + 1;
        END WHILE;
      END;
    
    END MODULE;
    
    
  8. Save the ESQL file.
  9. Ensure that the ESQL module property in the Create WS Response node points to the DemoCustomer_WebService_v10_CreateWSResponse module.
  10. Save the message flow.
  11. Make a copy of the DemoCustomer_WebService_v10.msgflow flow, calling the new flow DemoCustomer_WebService_v20.msgflow.
  12. Configure the ESQL module property in the Create WS Response node to point to the DemoCustomer_WebService_v20_CreateWSResponse module.
  13. Save the message flow.

You can now create the main WSRR Connectivity message flow, which will invoke these Web Services: Creating the main flow.

Main Page icon   Back to Building the WSRR Connectivity sample.