Mapping a SOAP message by using a conditional transform

You define SOAP message parts in a message map by using the Cast function and then you define transforms between its elements. To map between elements that are defined as specific or derived types, you might want to define some conditional transforms. You can configure the If, Else if, and Else transform to control the flow of the mapping between elements.

About this task

When you use an If, Else if, and Else transform between your SOAP_Domain_Msg input object and SOAP_Domain_Msg output object, you must manually configure each element in the SOAP_Domain_Msg. You must map each element in the SOAP_Domain_Msg input object to the corresponding output object so that you do not lose the information of the element.
Note: Elements that are part of the input object and do not have a transform that is defined to an output object are deleted from the output structure and their value is lost.

Procedure

Complete the following steps to configure the SOAP_Domain_Msg when the Mapping node is wired directly from a SOAPInput node with no SOAPExtract node:

  1. Define the transformation for the Context object.

    Copy the Context object by using the Move transform. For more information, see Specifying a transform (mapping operation).

    This figure shows the Move transform between the input Context object and the output Context object.

  2. Define the transformation for the Header object.

    You can define a Move transform between the input Header object and the output Header object to copy the structure and all its elements.

    Copy the Header object by using the Move transform.

    This figure shows the Move transform between the input Header object and the output Header object.

  3. Define the transformation for the Body object. Define SOAP Body parts by using the Cast function. You can cast attributes and other body parts. Then, define transforms between the input elements and the output elements in each body part. For more information, see Casting elements in a message map.
    1. Cast attributes that are defined as xsd:any into a specific type. Then, define a transform between the input attribute and the output attribute.
    2. Cast wildcard elements that are defined as xsd:any into a specific type.
    3. Cast a base type element to a derive type element. A derive type element is also known as an extension type element.

      In a message map, you cast a base type to a derive type or extension type so that you can define transformations between subtypes of a data type.

      For example, addresses are represented differently for different countries. You might want to map addresses from different countries into a common complex structure for addresses.
    4. Create and configure the If, Else if, and Else transform to control the flow of the mapping between elements that are defined as a specific or a derive type in the input and output message assembly by setting conditions.
  4. Optional: Define the transformation for the Attachment object. Copy the Attachment object by using the Move transform.

    You define SOAP attachment parts by using the Cast function.

Results

You have a message map that transforms a SOAP message. The message map contains a nested map that uses the If, Else if, and Else transform.

Example

The following figure shows a message map after you complete the previous steps to transform a SOAP message:

This figure shows the message map after the If, Else if, and Else transform is configured.

What to do next

Define more transforms between the input SOAP_Domain_Msg and the output SOAP_Domain_Msg. For more information, see Specifying a transform (mapping operation).