Expand Minimize

WsFlushWriter function

Instructs the writer to invoke the callback specified in WS_XML_WRITER_STREAM_OUTPUT if sufficient data has been buffered.

Syntax


HRESULT WINAPI  WsFlushWriter(
  _In_      WS_XML_WRITER* writer,
  _In_      ULONG minSize,
  _In_opt_  const WS_ASYNC_CONTEXT* asyncContext,
  _In_opt_  WS_ERROR* error
);

Parameters

writer [in]

The writer to flush.

minSize [in]

Specifies the minimum number of bytes that must be buffered in order for the callback to be invoked. If fewer than this number of bytes are buffered, then the callback will not be invoked. This can be used to minimize the number of i/o's that occur when writing small amounts of data.

Zero should be specified to guarantee that the callback is invoked.

asyncContext [in, optional]

Information on how to invoke the function asynchronously, or NULL if invoking synchronously.

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_S_ASYNC

The asynchronous operation is still pending.

 

Remarks

The writer buffers all data until WsFlushWriter is called.

If necessary, the WsFlushWriter should be called before WsFreeWriter to guarantee all data is emitted.

By specifying a WS_ASYNC_CONTEXT the buffered data will be written asynchronously.

This function is a no-op if the writer is using WS_XML_WRITER_BUFFER_OUTPUT.

If WsWriteStartElement has been called, but the element has not been committed (see WsWriteStartElement) then this element will not be flushed.

If this function is called when using WS_XML_WRITER_MTOM_ENCODING and there are no open elements on the writer, then the supporting MIME parts will be generated and emitted. Once this occurs, any API that attempts to write further to the XML document will return WS_E_INVALID_OPERATION. (See Windows Web Services Return Values.)

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