Configuring the Throw Fault Task

Procedure

  1. Select the ThrowFault task (at the end of the Otherwise path in the AddressService.mediation tab) and click the Browse button in the General tab of the Properties view.
  2. The Select a WSDL Message dialog displays. The first three messages are listed as InvalidCountryFaultMessage; a full pathname displays if you highlight the message. Select the message that corresponds to the AddressService.wsdl file and click OK.

    Select the Transform tool from the Data drawer of the palette, and add a Transform task in front of the ThrowFault task on the Otherwise path.

  3. Select the Transform task. On the Input tab of the Properties view, expand the MessageData tree, so that all parameters are visible.
  4. This message has to be modified to include an error message as well as the value of the invalid country code. To do this:
    1. Select the Functions tab and expand String Functions.

    2. Drag and drop a concat string function to the XPath Expression column next to invalidCountry.

    3. In the XPath Expression text box, type this return message to replace the <<string1>> placeholder, enclosing the message in double quotes:
      "Invalid country supplied: "
    4. Click the Data Source tab drag and drop country from the Message Data tree into the <<string2>> placeholder.

    5. Click the Show Check and Repair icon .
    6. One error displays. Select the checkbox in the Fix column for the displayed error and click OK.
  5. Save the project.