Table of Contents

Search

  1. Preface
  2. Web Services
  3. SOAP Web Services
  4. WSDL Data Object
  5. Schema Object
  6. How to Create a SOAP Web Service
  7. Operation Mappings
  8. Parsing Web Service SOAP Messages
  9. Generating Web Service SOAP Messages
  10. Web Service Consumer Transformation
  11. REST Web Services
  12. How to Create a REST Web Service
  13. REST Web Service Consumer Transformation
  14. REST Web Service Consumer Transformation Use Cases
  15. REST and SOAP Web Service Administration
  16. Datatype Compatibility

Web Services Guide

Web Services Guide

Union Element

Union Element

The union element is a simple type that is a union of more than one type. When a SOAP message contains a union element, you must map a single input port that contains the data in a string.
For example, the SOAP message contains an element called size. Size is a union of integer and string:
<xs:element name="size"> <xs:simpleType> <xs:union memberTypes="size_no size_string" /> </xs:simpleType> </xs:element>
The input rows contain items with a description and size. An item can have a numeric size, such as 42. Or, an item can have a size that is a string value, such as large, medium, or small.
The following table shows input rows with a numeric size and a string size:
Desc
Size
shoes
42
shirt
large
Create one port for the item size. Map the port as a string. The SOAP message contains the following elements:
<item> <desc>shoes</desc> <size>42</size> </item> <item> <desc>shirt</desc> <size>large</size> </item>

0 COMMENTS

We’d like to hear from you!