Expand Minimize

WsCreateWriter function

creates an XML Writer with the specified properties.

Syntax


HRESULT WINAPI  WsCreateWriter(
  const WS_XML_WRITER_PROPERTY* properties,
  _In_      ULONG propertyCount,
  WS_XML_WRITER** writer,
  _In_opt_  WS_ERROR* error
);

Parameters

properties

An array of WS_XML_WRITER_PROPERTY structures containing optional properties for the XML writer.

The value of this parameter may be NULL, in which case, the propertyCount parameter must be 0 (zero).

propertyCount [in]

The number of properties in the properties array.

writer

On success, a pointer that receives the address of the WS_XML_WRITER structure representing the created XML writer. When you no longer need this structure, you must free it by calling WsFreeWriter.

error [in, optional]

Pointer to a WS_ERROR structure that receives additional error information if the function fails.

Return value

If the function succeeds, it returns NO_ERROR; otherwise, it returns an HRESULT error code.

Return codeDescription
E_INVALIDARG

One or more arguments are invalid.

 

Remarks

Use the WsSetOutput or WsSetOutputToBuffer functions to choose the encoding of the XML writer and to indicate where to direct the output.

A WS_XML_WRITER can be reused by calling WsSetOutput or WsSetOutputToBuffer again.

See WS_XML_WRITER_PROPERTY_ID for the properties that can be used to configure the writer.

The XML writer buffers all data until WsFlushWriter is called. This allows the caller to determine at what granularity to write data and to whether to write that data asynchronously. Data is not written until WsFlushWriter is called.

If an operation on a WS_XML_WRITER fails the writer is left in a faulted state and further calls to the Writer return WS_E_OBJECT_FAULTED. (See Windows Web Services Return Values.)The only possible function calls for the XML writer if this occurs are WsSetOutput and WsSetOutputToBuffer to return the XML writer to a usable state, or WsFreeWriter to free the XML writer.

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