WS_TYPE_MAPPING enumeration (webservices.h)

How a WS_TYPE maps to or from XML when serialized or deserialized.

Syntax

typedef enum  {
  WS_ELEMENT_TYPE_MAPPING = 1,
  WS_ATTRIBUTE_TYPE_MAPPING = 2,
  WS_ELEMENT_CONTENT_TYPE_MAPPING = 3,
  WS_ANY_ELEMENT_TYPE_MAPPING = 4
} WS_TYPE_MAPPING;

Constants

 
WS_ELEMENT_TYPE_MAPPING
Value: 1
This is used when reading or writing an element where the type
corresponds to the type of the element.
The definition of the type may include mappings to attributes,
text, or child elements of the element.


The following calling sequence is used when writing an element:



syntax<br><br>WsWriteStartElement(...)<br>WsWriteType(..., WS_ELEMENT_TYPE_MAPPING, ...)<br>WsWriteEndElement(...)<br>

The following calling sequence is used when reading an element:



syntax<br><br>WsReadToStartElement(...)?<br>WsReadType(..., WS_ELEMENT_TYPE_MAPPING, ...)<br>
WS_ATTRIBUTE_TYPE_MAPPING
Value: 2
This is used when reading or writing the value of a single attribute. The definition
of the type must not require any mappings to attributes or child elements.


The following calling sequence is used when writing an attribute value.



syntax<br><br>WsWriteStartAttribute(...)<br>WsWriteType(..., WS_ATTRIBUTE_TYPE_MAPPING, ...)<br>WsWriteEndAttribute(...)<br>

The following calling sequence is used when reading an attribute value.



syntax<br><br>WsFindAttribute(...)<br>WsReadStartAttribute(...)<br>WsReadType(..., WS_ATTRIBUTE_TYPE_MAPPING, ...)<br>WsReadEndAttribute(...)<br>
WS_ELEMENT_CONTENT_TYPE_MAPPING
Value: 3
This is used when when the type corresponds to all or part of the
content (text and child elements) of an element.
The definition of the type may include mappings to text or child
elements, but must not include any attributes.


The following calling sequence is used when writing the contents
of an element:



syntax<br><br>WsWriteStartElement(...)<br>// Write attributes, if any<br>// Write other element content, if any<br>WsWriteType(..., WS_ELEMENT_CONTENT_TYPE_MAPPING, ...)<br>// Write other element content, if any<br>WsWriteEndElement(...)<br>

The following calling sequence is used when reading the contents of
an element:



syntax<br><br>WsReadToStartElement(...)<br>// Read attributes, if any<br>WsReadStartElement(...)<br>// Read other element content, if any<br>WsReadType(..., WS_ELEMENT_CONTENT_TYPE_MAPPING, ...)<br>// Read other element content, if any<br>WsReadEndElement(...)<br>
WS_ANY_ELEMENT_TYPE_MAPPING
Value: 4
This is used when when the type corresponds to the complete
element, including the name and namespace of the element.
The definition may include attributes and child elements
and text.


The following calling sequence is used when writing
an element:



syntax<br><br>WsWriteType(..., WS_ANY_ELEMENT_TYPE_MAPPING, ...)<br>

The following calling sequence is used when reading the contents of
an element:



syntax<br><br>WsReadToStartElement(...)?<br>WsReadType(..., WS_ANY_ELEMENT_TYPE_MAPPING, ...)<br>

Remarks

See the documentation for each WS_TYPE for which WS_TYPE_MAPPING values are supported.

Requirements

   
Minimum supported client Windows 7 [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 R2 [desktop apps | UWP apps]
Header webservices.h