Configuring an If, Else if, and Else transform in a message map
You use the If, Else if, and Else transform to set conditions that control the flow of the data mapping between SOAP body elements defined as a specific or a derived type in the input and output message assembly.
Before you begin
- Cast the input and output message assembly body element any to SaveAddress. For more information, see Casting the SOAP body into a specific type.
- Cast the Address base type defined in the input and output message assembly body to the CanadianAddress derived type, the UKAddress derived type, and the USAddress derived type. For more information, see Configuring derived types in the SOAP body.
About this task
You use an If, Else if, and Else transform to map multiple derived address types such as the CanadianAddress to the base address type Address.
- In a CanadianAddress, each address includes the element Province.
- In a UKAddress, each address includes the element County.
- In a USAddress, each address includes the element State.
The base address type Address includes an element named AdditionalInfo. You use this element to store additional information that does not have a corresponding element in the base address type.
Procedure
Complete the following steps to map a derived type to a base type by using an If, Else if, and Else transform in the scenario:
Results
You now have a map that transforms address data, based on the country of the address. The message map contains a nested map that uses the If, Else if, and Else transform that you defined.
The following figure shows the message map after you complete the previous steps:
What to do next
You have now completed all steps necessary to transform the sample SOAP message by using a message map that uses an If, Else if, and Else transform.