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:
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:
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.
- 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.
- 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.