How to Use Outbound Translation

This section demonstrates using outbound translation. Figure 20-22 shows a mediator (Mediator1) connected to a BPEL process. The mediator uses outbound translation to convert XML data into native string, and routes this string to the BPEL process.

Figure 20-22 Mediator Sending Outbound Data

Description of Figure 20-22 follows
Description of "Figure 20-22 Mediator Sending Outbound Data"

To translate outbound data from XML to native XSD format:

  1. Right-click the mediator (Mediator1), and select Edit.
  2. Under the routing rule that routes data from the mediator to the BPEL process (target service), click the icon to the right of the Translate To Native field. Figure 20-23 shows the routing rule section for Mediator1.

    Figure 20-23 Translate To Native Option

    Description of Figure 20-23 follows
    Description of "Figure 20-23 Translate To Native Option"
  3. In the Add Translation dialog box that appears, optionally edit the default input variable in the Input field. The Input field is populated with an intermediate input variable created by Mediator. This variable must be in the format translateToNative.in.some_name.

    Note:

    You can later assign a value to the intermediate input variable using the Assign or Transform action of the associated routing rule.

    Figure 20-24 shows the Add Translation dialog box.

    Figure 20-24 Add Translation Dialog

    Description of Figure 20-24 follows
    Description of "Figure 20-24 Add Translation Dialog"
  4. To the right of the NXSD Schema field, select the Search icon to invoke the Type Chooser dialog for selecting the schema. If the schema does not exist, you can click the second icon to create the schema.
  5. Select the schema, and click OK. The Element field is populated from the selected schema.
  6. Click the icon to the right of the Output field. The Expression Builder dialog appears.
  7. Double-click the output string in the Variables tree. Click OK.

    Figure 20-25 Completed Output String in Expression Builder

    Description of Figure 20-25 follows
    Description of "Figure 20-25 Completed Output String in Expression Builder"
  8. Click OK in the Add Translation dialog box.