Parsing XML Constructs in SOAP Messages
A SOAP message might contain XML constructs such as choice, list, and union elements.
Web service transformations can parse SOAP messages with these constructs with some limitations.
Choice Element
A choice element restricts a child element to one of the elements in the <choice> declaration.
The following text shows a person element that is an employee or a contractor:
<xs:element name="person">
<xs:complexType>
<xs:choice>
<xs:element name="employee" type="employee"/>
<xs:element name="contractor" type="contractor"/>
</xs:choice>
</xs:complexType>
</xs:element>
You can map choice elements using the following methods:
- •Create output ports for each choice element in an output group. Some elements will have null values in the output row.
- •Create an output group for each choice. For the above example, create an employee group and a contractor group. The Data Integration Service generates a row based on which element appears in the SOAP message.
List Element
A list is an XML element that can contain multiple simple type values, such as "Monday Tuesday Wednesday".
The Data Integration Service can return a list as a string value. When the SOAP message contains a list, you cannot map items from the list to separate output rows. You can configure an Expression transformation to separate the elements in the list if you need them separated in a mapping.
Union Element
The union element is a simple type that is a union of more than one type.
The following text shows an element Size that is a union of two simple types, size_no and size_string:
<xs:element name="Size">
<xs:simpleType>
<xs:union memberTypes="size_no size_string" />
</xs:simpleType>
</xs:element>
To map the size to an output port, create one port for the size. Configure the output port as a string. You can configure another transformation in the mapping to convert the data to another type.