WsOpenServiceHost function (webservices.h)
Opens a Service Host for communication and starts the Listeners on all the endpoints. Client applications cannot connect to Service endpoints until WsOpenSerivceHost is called.
Syntax
HRESULT WsOpenServiceHost(
[in] WS_SERVICE_HOST *serviceHost,
[in, optional] const WS_ASYNC_CONTEXT *asyncContext,
[in, optional] WS_ERROR *error
);
Parameters
[in] serviceHost
A pointer to the Service Host object to open. The pointer must reference a valid WS_SERVICE_HOST object returned by WsCreateServiceHost and the referenced Service Host value may not be NULL.
[in, optional] asyncContext
A pointer to A WS_ASYNC_CONTEXT object that has information about how to invoke the function asynchronously. The value is set to NULL if invoking synchronously.
[in, optional] error
A pointer to a WS_ERROR object where additional information about the error should be stored if the function fails.
Return value
This function can return one of these values.
Return code | Description |
---|---|
|
The asynchronous operation is still pending. |
|
The service host was aborted before the open, or during the open. |
|
The current state of the service proxy is not valid for this operation. |
|
The address is already being used. |
|
The address is not valid for this context. |
|
A quota was exceeded. |
|
The operation was aborted. |
|
The operation did not complete within the time allotted. |
|
Ran out of memory. |
|
One or more arguments are invalid. |
|
This function may return other errors not listed above. |
Remarks
Note that all the endpoints listeners have to successfully open before any channel is accepted by service host for communicating with the client.
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 |