WsCreateServiceEndpointFromTemplate function (webservices.h)

Helper routine for creating a service endpoint (WS_SERVICE_ENDPOINT) from policy templates.


HRESULT WsCreateServiceEndpointFromTemplate(
  [in]           WS_CHANNEL_TYPE                    channelType,
  [in]           const WS_SERVICE_ENDPOINT_PROPERTY *properties,
  [in]           ULONG                              propertyCount,
  [in, optional] const WS_STRING                    *addressUrl,
  [in]           const WS_SERVICE_CONTRACT          *contract,
  [in]           WS_SERVICE_SECURITY_CALLBACK       authorizationCallback,
  [in]           WS_HEAP                            *heap,
  [in]           WS_BINDING_TEMPLATE_TYPE           templateType,
  [in]           void                               *templateValue,
  [in]           ULONG                              templateSize,
  [in]           const void                         *templateDescription,
  [in]           ULONG                              templateDescriptionSize,
  [out]          WS_SERVICE_ENDPOINT                **serviceEndpoint,
  [in, optional] WS_ERROR                           *error


[in] channelType

A WS_CHANNEL_TYPE enumeration value representing the type of channel hosted by the endpoint.

[in] properties

An array of WS_SERVICE_ENDPOINT_PROPERTY structures containing properties for the service endpoint. (Application should fill in channel properties in the template structure.)

[in] propertyCount

The number of properties in the properties array.

[in, optional] addressUrl

The URL address on which the endpoint is to listen.

[in] contract

A WS_SERVICE_CONTRACT structure representing the contract of the endpoint.

[in] authorizationCallback

A WS_SERVICE_SECURITY_CALLBACK authorization callback for the service endpoint.

[in] heap

The heap from which memory for the service endpoint is allocated on successful return.

[in] templateType

A WS_BINDING_TEMPLATE_TYPE enumeration value representing the type of templates being used to create the service endpoint.

[in] templateValue

Optional template structure to be created and filled in by application. The template must be consistent with the input template type (passed in the templateType parameter). When the templateValue parameter is NULL, it is equivalent to the corresponding template structure initialized to zero.

[in] templateSize

The size, in bytes, of the input templateValue structure.

[in] templateDescription

The description of template structure (passed in the templateValue parameter). Needs to match templateType.

[in] templateDescriptionSize

The size of the template description.

[out] serviceEndpoint

On success, a pointer that receives the address of the WS_SERVICE_ENDPOINT structure representing the new service endpoint.

[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.


WsCreateServiceEndpointFromTemplate creates the WS_SERVICE_ENDPOINT structure from the specified input policy templates and additional user input.


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