WS_WRITE_OPTION enumeration (webservices.h)

Specifies whether a storage specified contains the value, or a pointer to the value, and whether the value can be represented as nil in the XML content.

Syntax

typedef enum {
  WS_WRITE_REQUIRED_VALUE = 1,
  WS_WRITE_REQUIRED_POINTER = 2,
  WS_WRITE_NILLABLE_VALUE = 3,
  WS_WRITE_NILLABLE_POINTER = 4
} WS_WRITE_OPTION;

Constants

 
WS_WRITE_REQUIRED_VALUE
Value: 1
The storage specified contains the value. The size of the storage
specified should be the size of the value.


This option specifies that the value will always be written to the XML content.



syntax<br>int value;<br>Api(..., &amp;value, sizeof(value), ...);<br>


syntax<br>// always written<br>&lt;element&gt;123&lt;/element&gt;<br>

This option is not supported for pointer types
(WS_WSZ_TYPE and WS_XML_BUFFER_TYPE).
The WS_WRITE_REQUIRED_POINTER option should be used for these types.
WS_WRITE_REQUIRED_POINTER
Value: 2
The storage specified contains a pointer to the value. The
size of the storage specified is always the size of a pointer, regardless
of the type being serialized.


This option specifies that the value will always be written to the XML content.



syntax<br>int* valuePointer; // may not be NULL<br>Api(..., &amp;valuePointer, sizeof(valuePointer), ...);<br>


syntax<br>// always written<br>&lt;element&gt;123&lt;/element&gt;<br>

If the pointer to the value specified in the storage is NULL,
E_INVALIDARG is returned.
(See Windows Web Services Return Values.)
WS_WRITE_NILLABLE_VALUE
Value: 3
The storage specified contains a pointer to the value. The
size of the storage specified is always the size of a pointer, regardless
of the type being serialized.


If the value is nil, then a nil element is written in the XML content.
If non-nil, then the value is serialized normally.



syntax<br>WS_STRING value; // may contain a nil value (see WS_STRING_TYPE)<br>Api(..., &amp;value, sizeof(value), ...);<br>


syntax<br>// if value is non-nil<br>&lt;element&gt;hello&lt;/element&gt;<br><br>// if value is nil<br>&lt;element xsi:nil='true'/&gt;<br>

This option is only supported for the following types, listed below,
which have a intrinsic way to represent a nil value. See the documentation
for each type for information on how nil is represented.
WS_WRITE_NILLABLE_POINTER
Value: 4
For all types, the storage specified contains a pointer to the value. The
size of the storage specified is always the size of a pointer, regardless
of the type being serialized.


If the pointer to the value specified in the storage is NULL, then
a nil element is written in the XML content.



syntax<br>int* valuePointer; // may be NULL<br>Api(..., &amp;valuePointer, sizeof(valuePointer), ...);<br><br>


syntax<br>// if value is non-NULL<br>&lt;element&gt;123&lt;/element&gt;<br><br>// if value is NULL<br>&lt;element xsi:nil='true'/&gt;<br>

Requirements

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