WsInitializeMessage function

This function initializes the headers for the message in preparation for processing. After a message has been initialized an application can add additional headers. On success the message is in WS_MESSAGE_STATE_INITIALIZED state. If the function fails, then no state transitions occurs.

Syntax


HRESULT WINAPI  WsInitializeMessage(
  _In_     WS_MESSAGE*               message,
  _In_     WS_MESSAGE_INITIALIZATION initialization,
  _In_opt_ WS_MESSAGE*               sourceMessage,
  _In_opt_ WS_ERROR*                 error
);

Parameters

message [in]

A pointer to the Message object to initialize. The Message must be a valid WS_MESSAGE object instance returned by WsCreateMessage or WsCreateMessageForChannel and may not be NULL.

initialization [in]

Defines the Message initialization.

Note  If the initialization value is set to WS_REPLY_MESSAGE or WS_FAULT_MESSAGE the message is automatically addressed.
 
sourceMessage [in, optional]

A pointer to a message object that is used to initialize the message parameter. This value should be NULL unless the initialization parameter has the value of WS_DUPLICATE_MESSAGE, WS_REPLY_MESSAGE, or WS_FAULT_MESSAGE.

error [in, optional]

A pointer to a WS_ERROR object where additional information about the error should be stored if the function fails.

Return value

This function can return one of these values.

Return codeDescription
E_OUTOFMEMORY

Ran out of memory.

E_INVALIDARG

One or more arguments are invalid.

Other Errors

This function may return other errors not listed above.

 

Remarks

The initial sender of a message should add an action header to the message using WsSetHeader.

This API must be called before WsWriteEnvelopeStart or WsWriteMessageStart is called for the message.

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: