Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

WsPushBytes function

Establishes a callback to be invoked to write bytes within an element. In some encodings this can be more efficient by eliminating a copy of the data.

Syntax


HRESULT WINAPI  WsPushBytes(
  _In_     WS_XML_WRITER*         writer,
  _In_     WS_PUSH_BYTES_CALLBACK callback,
  _In_opt_ void*                  callbackState,
  _In_opt_ WS_ERROR*              error
);

Parameters

writer [in]

A pointer to the XML Writer object to which the bytes are written. The pointer must reference a valid WS_XML_WRITER and the referenced value may not be NULL.

callback [in]

This parameter is the callback to invoke to write the data.

callbackState [in, optional]

A pointer to a user-defined state that is passed to the callback function.

error [in, optional]

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 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.

 

Remarks

When writing with the WS_XML_WRITER_MTOM_ENCODING, WsPushBytes provides a way to write bytes directly into its own MIME part and avoid a copy. However, the writer at its discretion, may choose to invoke the callback immediately, so the caller should be prepared for this.

If the encoding cannot take advantage of this behavior, then WsPushBytes will invoke the callback immediately and operate as if WsWriteBytes was called.

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

Show:
© 2017 Microsoft