Windows Dev Center

Expand Minimize

WsReadType function

Read a value of a given WS_TYPE from XML according to the WS_TYPE_MAPPING.

Syntax


HRESULT WINAPI  WsReadType(
  _In_     WS_XML_READER*  reader,
  _In_     WS_TYPE_MAPPING typeMapping,
  _In_     WS_TYPE         type,
  _In_opt_ const void*     typeDescription,
  _In_     WS_READ_OPTION  readOption,
  _In_opt_ WS_HEAP*        heap,
           void*           value,
  _In_     ULONG           valueSize,
  _In_opt_ WS_ERROR*       error
);

Parameters

reader [in]

The reader that is positioned on the XML to deserialize.

typeMapping [in]

Describes how the type maps to the XML that is being read.

type [in]

The type of the value to deserialize.

typeDescription [in, optional]

Additional information about the type. Each type has a different description structure. This may be NULL, depending on the WS_TYPE.

readOption [in]

Whether the value is required, and how to allocate the value. See WS_READ_OPTION for more information.

This parameter must have one of the following values:

heap [in, optional]

The heap to store the deserialized values in.

value

The interpretation of this parameter depends on the WS_READ_OPTION.

valueSize [in]

The interpretation of this parameter depends on the WS_READ_OPTION.

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

WS_E_QUOTA_EXCEEDED

The size quota of the heap was exceeded.

E_INVALIDARG

One or more arguments are invalid.

 

Remarks

See WS_TYPE_MAPPING for how to use this function to read values from elements and attributes.

If the API fails, the state of input reader becomes undefined. The only APIs that may be used on the reader if this occurs are WsSetInput and WsSetInputToBuffer to return the reader to a usable state, or WsFreeReader to free the reader.

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:
© 2015 Microsoft