Expand Minimize

WsFillBody function

Ensures that there are a sufficient number of bytes available in a message for reading. It is up to the application to specify the number of bytes sufficient to contain the next XML construct to read.

Note  This function is called before using WsReadBody or the XML Reader of the message to read the message body.

This function is a shortcut for calling WsFillReader for the XML Reader being used to write the message. Calling WsFillReader directly is equivalent to calling this function.

Syntax


HRESULT WINAPI  WsFillBody(
  _In_      WS_MESSAGE* message,
  _In_      ULONG minSize,
  _In_opt_  const WS_ASYNC_CONTEXT* asyncContext,
  _In_opt_  WS_ERROR* error
);

Parameters

message [in]

A pointer to the WS_MESSAGE structure intended for "filling".

minSize [in]

The minimum number of bytes that the message should have buffered. If the current byte count buffered is equal to or greater than the value of minSize the function does nothing.

Note  The value of minSize represents the size of the encoded form of the XML that is expected. This can vary by encoding and also how the actual XML is structured. Typical use of this function is to select an expected upper bound byte count for encoding or XML structure to ensure that the expected data is read.

asyncContext [in, optional]

A pointer to a WS_ASYNC_CONTEXT data structure with information about invoking the function asynchronously. A NULL value indicates a request for synchronous operation.

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
S_OK

Start of message was received successfully.

WS_S_ASYNC

The asynchronous operation is still pending.

WS_E_INVALID_FORMAT

The input data was not in the expected format or did not have the expected value.

E_INVALIDARG

One or more arguments are invalid.

E_OUTOFMEMORY

Ran out of memory.

Other Errors

This function may return other errors not listed above.

 

Remarks

This function is typically used when writing the message body with streamed mode set to WS_STREAMED_OUTPUT_TRANSFER_MODE, or when using an XML Reader in streamed mode.

This function is a "no-op" when writing the message body and WS_STREAMED_OUTPUT_TRANSFER_MODE is not set, or with an XML Reader's mode set to WS_XML_READER_BUFFER_INPUT.

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