WsWriteCharsUtf8 function (webservices.h)

Writes a series of characters encoded as UTF-8 to an element or attribute. To write characters to an attribute value, call WsWriteStartAttribute first. Only whitespace characters may be written at the root of an xml document unless the WS_XML_WRITER_PROPERTY_ALLOW_FRAGMENT has been set to TRUE.

Syntax

HRESULT WsWriteCharsUtf8(
  [in]           WS_XML_WRITER *writer,
                 const BYTE    *bytes,
  [in]           ULONG         byteCount,
  [in, optional] WS_ERROR      *error
);

Parameters

[in] writer

A pointer to the WS_XML_WRITER object to which the characters are written. The pointer must reference a valid XML Writer object.

bytes

A pointer to the encoded UTF-8 characters to write.

[in] byteCount

The number of bytes to write.

[in, optional] error

A pointer to a WS_ERROR object where additional information about the error should be stored if the function fails.

Return value

This function can return one of these values.

Return code Description
E_INVALIDARG
One or more arguments are invalid.
WS_E_INVALID_OPERATION
The operation is not allowed due to the current state of the object.

Remarks

WsWriteCharsUtf8 can be called more than once between WsWriteStartAttribute and WsWriteEndAttribute. It cannot be combined with WsWriteChars, WsWriteBytes, WsWriteValue or WsWriteText when writing an attribute.

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 R2 [desktop apps | UWP apps]
Target Platform Windows
Header webservices.h
Library WebServices.lib
DLL WebServices.dll