Expand Minimize

WsWriteXmlBufferToBytes function

Uses a writer to convert a WS_XML_BUFFER to an encoded set of bytes.

Syntax


HRESULT WINAPI  WsWriteXmlBufferToBytes(
  _In_      WS_XML_WRITER* writer,
  _In_      WS_XML_BUFFER* xmlBuffer,
  _In_opt_  const WS_XML_WRITER_ENCODING* encoding,
  const WS_XML_WRITER_PROPERTY* properties,
  _In_      ULONG propertyCount,
  _In_      WS_HEAP* heap,
  void** bytes,
  _Out_     ULONG* *byteCount,
  _In_opt_  WS_ERROR* error
);

Parameters

writer [in]

The writer to use to generate the encoded bytes.

xmlBuffer [in]

The XML buffer to write.

encoding [in, optional]

The encoding to use when generating the bytes. If NULL, the bytes will be encoded in utf8.

properties

An array of optional properties of the writer. See WS_XML_WRITER_PROPERTY.

propertyCount [in]

The number of properties.

heap [in]

The heap from which to allocate the bytes.

bytes

The generated bytes are returned here.

byteCount [out]

The number of generated bytes are returned here.

error [in, optional]

Specifies where additional error information should be stored if the function fails.

Return value

This function can return one of these values.

Return codeDescription
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 generate the entire contents of the WS_XML_BUFFER as a linear set of bytes allocated from the specified heap in the encoding specified.

The writer will be left in an undefined state after calling this function. However, WsWriteXmlBufferToBytes may be used again with such a writer. Otherwise, WsSetOutput or WsSetOutputToBuffer should be used to bring the writer back to a known state, or the writer should be freed using WsFreeWriter.

Requirements

Minimum supported client

Windows 7 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2008 R2 [desktop apps | Windows Store apps]

Header

WebServices.h

Library

WebServices.lib

DLL

WebServices.dll

 

 

Community Additions

ADD
Show:
© 2014 Microsoft