WsCreateListener function (webservices.h)

Creates a listener with the specified properties.

Syntax

HRESULT WsCreateListener(
  [in]           WS_CHANNEL_TYPE               channelType,
  [in]           WS_CHANNEL_BINDING            channelBinding,
                 const WS_LISTENER_PROPERTY    *properties,
  [in]           ULONG                         propertyCount,
  [in, optional] const WS_SECURITY_DESCRIPTION *securityDescription,
                 WS_LISTENER                   **listener,
  [in, optional] WS_ERROR                      *error
);

Parameters

[in] channelType

The type of channel the listener listens for. For channel types, see the WS_CHANNEL_TYPE enumeration.

[in] channelBinding

The channel protocol for the listener. For possible bindings, see the WS_CHANNEL_BINDING enumeration.

properties

Pointer to a WS_LISTENER_PROPERTY structure containing optional properties for the listener.

For information on which properties you can specify when creating a listener, see the WS_LISTENER_PROPERTY_ID enumeration.

For information on creating a custom listener, see the Remarks section.

[in] propertyCount

The number of properties in the properties array.

[in, optional] securityDescription

Pointer to a WS_SECURITY_DESCRIPTION structure specifying the security for the listener.

If you are creating a custom channel (using the WS_CUSTOM_CHANNEL_BINDING value of the WS_CHANNEL_BINDING enumeration), the security description must be NULL. See the Remarks section.

listener

On success, a pointer that receives the address of the WS_LISTENER structure representing the new listener.

[in, optional] error

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 code Description
WS_E_QUOTA_EXCEEDED
A quota was exceeded.
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

When you create a custom listener (using the WS_CUSTOM_CHANNEL_BINDING value of the WS_CHANNEL_BINDING enumeration), you can specify only the following channel properties:

  • WS_LISTENER_PROPERTY_CUSTOM_LISTENER_CALLBACKS
  • WS_LISTENER_PROPERTY_CUSTOM_LISTENER_PARAMETERS
(See the WS_LISTENER_PROPERTY_ID enumeration.) If other initial properties are required to create the custom listener, specify them by using the WS_LISTENER_PROPERTY_CUSTOM_LISTENER_PARAMETERS property.

To pass security information to a custom listener implementation, use the WS_LISTENER_PROPERTY_CUSTOM_LISTENER_PARAMETERS value of the WS_LISTENER_PROPERTY_ID enumeration.

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps only]
Minimum supported server Windows Server 2008 R2 [desktop apps only]
Target Platform Windows
Header webservices.h
Library WebServices.lib
DLL WebServices.dll