Expand Minimize

WsAddressMessage function

Addresses a message to a specified endpoint address.

Syntax


HRESULT WINAPI  WsAddressMessage(
  _In_      WS_MESSAGE* message,
  _In_opt_  const WS_ENDPOINT_ADDRESS* address,
  _In_opt_  WS_ERROR* error
);

Parameters

message [in]

Pointer to a WS_MESSAGE structure respresenting the message to be addressed.

address [in, optional]

Pointer to a WS_ENDPOINT_ADDRESS structure containing the endpoint to which to address the message.

Note  Passing NULL to this parameter indicates that no headers are added to the message. This provides a way to set the WS_MESSAGE_PROPERTY_ID to WS_MESSAGE_PROPERTY_IS_ADDRESSED without modifying the set of headers in the message.

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
WS_E_INVALID_OPERATION

The message has already been addressed. (The WS_MESSAGE_PROPERTY_IS_ADDRESSED property indicates whether a message has already been addressed.)

E_INVALIDARG

One or more arguments are not valid.

WS_E_INVALID_FORMAT

The input data was not in the expected format or did not have the expected value.

E_OUTOFMEMORY

Insufficient memory to complete the operation.

Other Errors

This function can return other errors not listed above.

 

Remarks

If you do not address a message by calling this function, the channel automatically addresses the message with the Endpoint Address passed to WsOpenChannel.

This function marks the message as addressed by setting the WS_MESSAGE_PROPERTY_IS_ADDRESSED property to TRUE.

This function fails if the message has already been addressed and returns WS_E_INVALID_OPERATION.

If a non-NULLWS_ENDPOINT_ADDRESS is passed to the function, the function performs the following additional steps:

  • The header type is set to WS_TO_HEADER (see the WS_HEADER_TYPE enumeration) and the address is set to the value of the url field of WS_ENDPOINT_ADDRESS. If the URL length is zero the WS_ADDRESSING_VERSION-specific representation for an anonymous URL is set for the message.
  • Each header in the WS_XML_BUFFER specified in the headers field of the WS_ENDPOINT_ADDRESS is added to the message. No headers are added if the buffer is NULL.

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