WS_WRITE_OPTION enumeration
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
enum WS_WRITE_OPTION { WS_WRITE_REQUIRED_VALUE,
WS_WRITE_REQUIRED_POINTER,
WS_WRITE_NILLABLE_VALUE,
WS_WRITE_NILLABLE_POINTER
};
Constants
- WS_WRITE_REQUIRED_VALUE
-
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.
int value; Api(..., &value, sizeof(value), ...);
// always written <element>123</element>
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
-
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.
int* valuePointer; // may not be NULL Api(..., &valuePointer, sizeof(valuePointer), ...);
// always written <element>123</element>
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
-
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.
WS_STRING value; // may contain a nil value (see WS_STRING_TYPE) Api(..., &value, sizeof(value), ...);
// if value is non-nil <element>hello</element> // if value is nil <element xsi:nil='true'/>
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
-
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.
int* valuePointer; // may be NULL Api(..., &valuePointer, sizeof(valuePointer), ...);
// if value is non-NULL <element>123</element> // if value is NULL <element xsi:nil='true'/>
Requirements
|
Minimum supported client | Windows 7 [desktop apps | Windows Store apps] |
|---|---|
|
Minimum supported server | Windows Server 2008 R2 [desktop apps | Windows Store apps] |
|
Header |
|