Expand Minimize

WsCreateReader function

Creates an XML reader with the specified properties.

Syntax


HRESULT WINAPI  WsCreateReader(
  const WS_XML_READER_PROPERTY* properties,
  _In_      ULONG propertyCount,
  WS_XML_READER** reader,
  _In_opt_  WS_ERROR* error
);

Parameters

properties

An array of WS_XML_READER_PROPERTY structures containing optional properties for the XML reader.

The value of this parameter may be NULL, in which case, the propertyCount parameter must be 0 (zero).

For the properties that tiy can use to configure the XML reader. see the WS_XML_READER_PROPERTY_ID enumeration.

propertyCount [in]

The number of properties in the properties array.

reader

On success, a pointer that receives the address of the WS_XML_READER structure representing the new XML reader. When you no longer need this structure, you must free it by calling WsFreeReader.

error [in, optional]

Pointer to a WS_ERROR structure that receives additional error information if the function fails.

Return value

If the function succeeds, it returns NO_ERROR; otherwise, it returns an HRESULT error code.

Security

See the Security section in the XML Reader topic.

Remarks

Use WsSetInput or WsSetInputToBuffer functions to choose the encoding for the XML reader and to indicate the source of the input.

If WS_READ_CALLBACK is specified in the WS_XML_READER_INPUT structure passed to the WsSetInput function, the XML reader reads additional data only when WsFillReader is called. This allows the caller to determine at what granularity to read data and whether to read that data asynchronously.

A WS_XML_READER structure can be reused by calling WsSetInput or WsSetInputToBuffer again.

If any API operation that operates on an WS_XML_READER fails the XML reader is left in a faulted state and further function calls return WS_E_OBJECT_FAULTED. (See Windows Web Services Return Values.) The only possible function calls for the XML reader if this occurs are WsSetInput and WsSetInputToBuffer for returning the XML reader to a usable state, or WsFreeReader for releasing the XML reader object.

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