WsReadXmlBufferFromBytes function (webservices.h)

Uses a reader to convert a set of encoded bytes to a WS_XML_BUFFER.

Syntax

HRESULT WsReadXmlBufferFromBytes(
  [in]           WS_XML_READER                *reader,
  [in, optional] const WS_XML_READER_ENCODING *encoding,
                 const WS_XML_READER_PROPERTY *properties,
  [in]           ULONG                        propertyCount,
                 const void                   *bytes,
  [in]           ULONG                        byteCount,
  [in]           WS_HEAP                      *heap,
                 WS_XML_BUFFER                **xmlBuffer,
  [in, optional] WS_ERROR                     *error
);

Parameters

[in] reader

The reader to use to parse the encoded bytes.

[in, optional] encoding

The encoding to use when parsing the bytes. If NULL, a WS_XML_READER_TEXT_ENCODING with a charset of WS_CHARSET_AUTO will be used.

properties

An array of optional properties of the reader. See WS_XML_READER_PROPERTY.

[in] propertyCount

The number of properties.

bytes

The bytes to parse.

[in] byteCount

The number of bytes to parse.

[in] heap

The heap from which to allocate the XML buffer.

xmlBuffer

The XML buffer into which the bytes were read is returned here.

[in, optional] error

Specifies where additional error information 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.
WS_E_QUOTA_EXCEEDED
A quota was exceeded.

Remarks

The function will parse the entire contents according to the specified encoding and store it into a WS_XML_BUFFER.

The reader will be left in an undefined state after calling this function. However, WsReadXmlBufferFromBytes may be used again with such a reader. Otherwise, WsSetInput or WsSetInputToBuffer should be used to bring the reader back to a known state, or the reader should be freed using WsFreeReader.

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