How to Use Inbound Translation

This section demonstrates using inbound translation. Figure 20-18 shows a mediator (Mediator1) connected to an inbound web service. The mediator receives a native string from the inbound web service, and uses inbound translation to convert the native string into XML.

Figure 20-18 Mediator Receiving Inbound Data

Description of Figure 20-18 follows
Description of "Figure 20-18 Mediator Receiving Inbound Data"

To translate inbound data from native XSD to XML format:

  1. Right-click the mediator (Mediator1), and select Edit.
  2. Under the Operations section, click the icon to the right of the Translate From Native field. Figure 20-19 shows the Operations section for Mediator1.

    Figure 20-19 Translate From Native Option

    Description of Figure 20-19 follows
    Description of "Figure 20-19 Translate From Native Option "
  3. In the Add Translation dialog box that appears, click the icon to the right of the Input field. The Expression Builder dialog appears.
  4. Double-click the input string in the Variables tree. Wrap (cast) the input string that appears in the Expression field with the string() function. Figure 20-20 shows the Expression Builder dialog with the completed input string. Click OK.

    Figure 20-20 Completed Input String in Expression Builder

    Description of Figure 20-20 follows
    Description of "Figure 20-20 Completed Input String in Expression Builder"
  5. 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.
  6. Select the schema, and click OK. The Element field is populated from the selected schema. The Output field is populated with an intermediate output variable created by Mediator. This variable must be in the format translateFromNative.out.some_name.

    Figure 20-21 shows the completed Add Translation dialog.

    Figure 20-21 Add Translation Dialog

    Description of Figure 20-21 follows
    Description of "Figure 20-21 Add Translation Dialog"
  7. Click OK. The Translate From Native field is populated.