Expand Minimize

WsWriteType function

Write a value of a given WS_TYPE to XML according to the WS_TYPE_MAPPING.

Syntax


HRESULT WINAPI  WsWriteType(
  _In_      WS_XML_WRITER* writer,
  _In_      WS_TYPE_MAPPING typeMapping,
  _In_      WS_TYPE type,
  _In_opt_  const void* typeDescription,
  _In_      WS_WRITE_OPTION writeOption,
  const void* value,
  _In_      ULONG valueSize,
  _In_opt_  WS_ERROR* error
);

Parameters

writer [in]

The writer to write the value to.

typeMapping [in]

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

type [in]

The type of the value to serialize.

typeDescription [in, optional]

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

writeOption [in]

Whether the value is required, and how the value is allocated. See WS_WRITE_OPTION for more information.

This parameter must have one of the following values:

value

A pointer to the value to serialize.

valueSize [in]

The size of the value being serialized.

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

See WS_TYPE_MAPPING for how to use this function to write values in elements and attributes.

If the API fails, the state of input writer becomes undefined. The only APIs that may be used on the writer if this occurs are WsSetOutput and WsSetOutputToBuffer to return the writer to a usable state, or WsFreeWriter to free the writer.

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