Expand Minimize

WsGetHeader function

Finds a particular standard header in the message and deserializes it.

Syntax


HRESULT WINAPI  WsGetHeader(
  _In_      WS_MESSAGE* message,
  _In_      WS_HEADER_TYPE headerType,
  _In_      WS_TYPE valueType,
  _In_      WS_READ_OPTION readOption,
  _In_opt_  WS_HEAP* heap,
  void* value,
  _In_      ULONG valueSize,
  _In_opt_  WS_ERROR* error
);

Parameters

message [in]

The message containing the header.

The message can be in any state but WS_MESSAGE_STATE_EMPTY.

headerType [in]

The type of header to deserialize.

valueType [in]

The type of value to deserialize. See WS_HEADER_TYPE for the set of types which correspond to each type of header.

readOption [in]

Whether the value is required, and how to allocate the value. WS_READ_NILLABLE_VALUE and WS_READ_NILLABLE_POINTER read options cannot be specified since the header types in WS_HEADER_TYPE are not allowed to be nillable in the respective standards specifications. See WS_READ_OPTION for more information.

heap [in, optional]

The heap to store the deserialized header data in. If this is NULL, then the message heap will be used.

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 header does not exist, and is required.

There are multiple instances of the type of header present in the message.

The input data was not in the expected format.

WS_E_QUOTA_EXCEEDED

There size quota of the heap was exceeded.

E_OUTOFMEMORY

There was not enough memory available to deserialize the header.

E_INVALIDARG

One or more of the parameters are incorrect.

Other Errors

This function may return other errors not listed above.

 

Remarks

This API provides access to a set of standard header types (see WS_HEADER_TYPE). For application defined header types, use WsGetCustomHeader.

This API is designed handle types of headers that appear once in the message and are targeted at the ultimate receiver. Headers targeted with a role/actor other than ultimate receiver are ignored by this API.

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