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.

WsWriteElement function

Write a typed value as an XML element.

Syntax


HRESULT WINAPI  WsWriteElement(
  _In_     WS_XML_WRITER*                writer,
  _In_     const WS_ELEMENT_DESCRIPTION* elementDescription,
  _In_     WS_WRITE_OPTION               writeOption,
           const void*                   value,
  _In_     ULONG                         valueSize,
  _In_opt_ WS_ERROR*                     error
);

Parameters

writer [in]

The writer to write the element to.

elementDescription [in]

A pointer to a description of how to serialize the element.

writeOption [in]

Information about how the value is allocated. See WS_WRITE_OPTION for more information.

value

A pointer to the value to serialize.

valueSize [in]

The size of the value being serialized, in bytes.

If the value is NULL, then the size should be 0.

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.

 

Remarks

This API writes the start element, the attributes, child elements / text, and the end element that corresponds to the specified value.

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

Show:
© 2016 Microsoft