Expand Minimize

WsCreateMessage function

Creates a message object with the specified properties.

Syntax


HRESULT WINAPI  WsCreateMessage(
  _In_      WS_ENVELOPE_VERSION envelopeVersion,
  _In_      WS_ADDRESSING_VERSION addressingVersion,
  const WS_MESSAGE_PROPERTY* properties,
  _In_      ULONG propertyCount,
  WS_MESSAGE** message,
  _In_opt_  WS_ERROR* error
);

Parameters

envelopeVersion [in]

A WS_ENVELOPE_VERSION enumeration value that specifies the version of the envelope for the message.

addressingVersion [in]

A WS_ADDRESSING_VERSION that specifies the version of the addressing for the message.

properties

An array of optional properties for the message. See WS_MESSAGE_PROPERTY.

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

propertyCount [in]

The number of properties in the properties array.

message

On success, a pointer that receives the address of a WS_MESSAGE structure representing the new message.

When you no longer need this structure, you must free it by calling WsFreeMessage.

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.

Return codeDescription
E_OUTOFMEMORY

Insufficient memory to complete the operation.

E_INVALIDARG

One or more arguments are invalid.

Other Errors

This function may return other errors not listed above.

 

Remarks

A message object is the delivery vehicle for Windows Web Services. A single message object can be used to send or receive sequential messages. Reusing a message object in this way can reduce memory allocations. When you no longer need the message, you must free the memory by calling WsFreeMessage. (For more information on reusing message objects, see WsResetMessage .)

If you are creating a message for use with a particular channel, use the WsCreateMessageForChannel function, which will ensure the correct message version for the channel.

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