Skip to content

Latest commit

 

History

History
165 lines (135 loc) · 4.99 KB

nf-webservices-wsreadbody.md

File metadata and controls

165 lines (135 loc) · 4.99 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:webservices.WsReadBody
WsReadBody function (webservices.h)
This is a helper function that deserializes a value from the XML Readerof the message. The WS_MESSAGE_STATE must be set to WS_MESSAGE_STATE_READING. This function does not cause any state transitions.
WsReadBody
WsReadBody function [Web Services for Windows]
webservices/WsReadBody
wsw.wsreadbody
wsw\wsreadbody.htm
wsw
43ceeb1e-aeb2-4482-90f0-d7f6013b239f
12/05/2018
WsReadBody, WsReadBody function [Web Services for Windows], webservices/WsReadBody, wsw.wsreadbody
webservices.h
Windows
Windows 7 [desktop apps \| UWP apps]
Windows Server 2008 R2 [desktop apps \| UWP apps]
WebServices.lib
WebServices.dll
Windows
19H1
WsReadBody
webservices/WsReadBody
c++
APIRef
kbSyntax
DllExport
WebServices.dll
WsReadBody

WsReadBody function

-description

This is a helper function that deserializes a value from the XML Readerof the message. The WS_MESSAGE_STATE must be set to WS_MESSAGE_STATE_READING. This function does not cause any state transitions.

-parameters

-param message [in]

A pointer to the Message object to read the body from. The pointer must reference a valid WS_MESSAGE object.

-param bodyDescription [in]

A pointer to the object encapsulating the metadata that describes the mapping of the value to an element.

-param readOption [in]

Determines whether the value is required and how to allocate the value. See WS_READ_OPTION for more information.

-param heap [in, optional]

A pointer to the Heap object to read the element into. The pointer must reference a valid WS_HEAP object.

-param value

The interpretation of the data referenced by this parameter depends on the WS_READ_OPTION.

-param valueSize [in]

The interpretation of the value of this parameter depends on the WS_READ_OPTION.

-param error [in, optional]

A pointer to a WS_ERROR object where additional information about the error should be stored if the function fails.

-returns

This function can return one of these values.

Return code Description
WS_E_INVALID_FORMAT
The input data was not in the expected format or did not have the expected value.
E_OUTOFMEMORY
Ran out of memory.
E_INVALIDARG
One or more arguments are invalid.
Other Errors
This function may return other errors not listed above.

-remarks

This functions supports the following scenarios, based on the contents of the WS_ELEMENT_DESCRIPTION supplied:

  • Reading a single element. In this case, the elementLocalName and elementNs fields of the WS_ELEMENT_DESCRIPTION should be set to the local name and namespace of the element to read, and the type and type description represents the type of the value being deserialized. If using WS_FAULT_TYPE or WS_ENDPOINT_ADDRESS_TYPE it is not necessary to specify the local name, namespace, or type description (they will default appropriately based on the envelope/addressing version of the message).
  • Reading multiple elements as a single value. In this case, the elementLocalName and elementNs fields of the WS_ELEMENT_DESCRIPTION should be set to NULL, and a WS_STRUCT_TYPE and WS_STRUCT_DESCRIPTION should be specified. In this case, each field of the structure value being deserialized should correspond to element(s) to read within the body.
  • Reading multiple elements as multiple values. Reading multiple distinct values can be accomplished by simply calling the function multiple times.