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 and SOAP Web Service Administration
  15. Datatype Compatibility

Web Services Guide

Web Services Guide

Choice Element

Choice Element

A choice element restricts a child element to one of the elements in the <choice> declaration.
To map ports to a SOAP message that contains choice elements, create one input group that includes all the elements in the choice construct. For example, an item description might be a dimension or a weight:
item: description, choice {dimension, weight}
When the description is a dimension, the description is a complex type that contains, length, width, and height.
When the description is a weight, the description is a simple string type.
The input data has the following columns and rows:
description
length
width
height
weight
box
20cm
18cm
15cm
NULL
coffee
NULL
NULL
NULL
500g
The SOAP message contains an Item group that contains dimensions or weight descriptions:
Item Description Dimension Length Width Height Weight
The NULL values in the input data become missing elements in the XML output.
The SOAP message contains the following data:
<item> <desc>box</desc> <dimension> <length>20cm</length> <width>18cm</width> <height>15cm</height> </dimension> </item> <item> <desc>coffee</desc> <weight>500g</weight> </item>