共用方式為


WsCreateServiceEndpointFromTemplate 函式 (webservices.h)

從原則範本建立服務端點的協助程式例程 (WS_SERVICE_ENDPOINT) 。

語法

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

WS_CHANNEL_TYPE列舉值,表示端點所裝載的通道類型。

[in] properties

包含服務端點屬性 之WS_SERVICE_ENDPOINT_PROPERTY 結構的陣列。 (應用程式應該填入範本結構中的通道屬性。)

[in] propertyCount

屬性陣列中的 屬性 數目。

[in, optional] addressUrl

端點要接聽的URL位址。

[in] contract

表示端點合約 的WS_SERVICE_CONTRACT 結構。

[in] authorizationCallback

服務端點 的WS_SERVICE_SECURITY_CALLBACK 授權回呼。

[in] heap

在成功傳回時配置服務端點記憶體的 堆積

[in] templateType

WS_BINDING_TEMPLATE_TYPE列舉值,表示用來建立服務端點的範本類型。

[in] templateValue

要由應用程式建立和填入的選擇性範本結構。 範本必須與 在templateType 參數中傳遞 (輸入範本類型) 一致。 當 templateValue 參數為 NULL 時,它相當於初始化為零的對應範本結構。

[in] templateSize

輸入 templateValue 結構的大小,以位元組為單位。

[in] templateDescription

範本結構的描述 (在 templateValue 參數中傳遞) 。 必須符合 templateType。

[in] templateDescriptionSize

範本描述的大小。

[out] serviceEndpoint

成功時,會接收表示新服務端點之 WS_SERVICE_ENDPOINT 結構的位址的指標。

[in, optional] error

WS_ERROR 結構的指標,如果函式失敗,則會接收其他錯誤資訊。

傳回值

如果函式成功,它會傳回NO_ERROR;否則,它會傳回 HRESULT 錯誤碼。

備註

WsCreateServiceEndpointFromTemplate 會從指定的輸入原則範本和其他使用者輸入建立 WS_SERVICE_ENDPOINT 結構。

規格需求

需求
最低支援的用戶端 Windows 7 [僅限傳統型應用程式]
最低支援的伺服器 Windows Server 2008 R2 [僅限傳統型應用程式]
目標平台 Windows
標頭 webservices.h
程式庫 WebServices.lib
Dll WebServices.dll