IBM Integration Bus, Version 9.0.0.5 Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS

See information about the latest product version

Configuring derived types in the SOAP body

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

Cast the SOAP body element SaveAddress in your message map. Complete the steps outlined in Casting the SOAP body into a specific type.

Your message map input Message Assembly should look like the one in the following figure:

This figure shows the message map with the SaveAddress element included in the input object.

A derived type is a datatype that is related to another datatype known as the base type or supertype.

In the scenario, Address is the base type, and USAddress, CanadianAddress, and UKAddress are derived types of Address.

Requests to save an address can come from Canada, the US, or the UK. Addresses are represented differently for each country, for example, in Canada the address includes the province. The AddressBook service stores all addresses in a single location using a common complex structure for addresses.

Complete the following steps to cast the Address base type to its derived types, so that addresses from different countries can be mapped into a common complex address type:

  1. Select Address.
  2. Right-click Address, and then select Cast.
    This figure shows graphically how to cast a base type Address. Right-click Address, and then select Cast.
  3. In the Type Selection window, choose a matching type, and then select OK.

    The options available correspond to specific address types in the schema model that have been modeled using Address as the base type.

    The following figure shows the Type Selection window that you get:

    This figure shows the Type Selection window that opens when you select Cast....
    1. Optional: Check the schema model in the Application Development view. Select the AddressBook service located under Resources > Schema definitions > http://addressbook.com.
      This figure shows the AddressBook service structure in the Application Development view. It has a red square around the addresses.xsd file.

The message map contains two entries for Address. One corresponds to the base type Address. The other entry corresponds to an Address with the derived type CanadianAddress.

This figure shows the message map including two entries for Address, one with a base type, and one with a CanadianAddress derived type.
  1. Repeat the steps to add the following derived types: UKAddress, and USAddress. The following figure shows your message map input object after you add all the derived addresses.
    This figure shows your message map input object after you add all the derived addresses.
  2. Define a conditional transform between elements of the SOAP body. For more information, see Configuring an If, Else if, and Else transform in a message map.

scnmap_03_26_.htm | 
        
        Last updated:
        
        Last updated: 2016-08-12 11:20:26