WsOpenServiceHost function

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 WINAPI  WsOpenServiceHost(
  _In_     WS_SERVICE_HOST*        serviceHost,
  _In_opt_ const WS_ASYNC_CONTEXT* asyncContext,
  _In_opt_ WS_ERROR*               error
);

Parameters

serviceHost [in]

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.

asyncContext [in, optional]

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.

error [in, optional]

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 codeDescription
WS_S_ASYNC

The asynchronous operation is still pending.

WS_E_OPERATION_ABORTED

The service host was aborted before the open, or during the open.

WS_E_INVALID_OPERATION

The current state of the service proxy is not valid for this operation.

WS_E_ADDRESS_IN_USE

The address is already being used.

WS_E_ADDRESS_NOT_AVAILABLE

The address is not valid for this context.

WS_E_QUOTA_EXCEEDED

A quota was exceeded.

WS_E_OPERATION_ABORTED

The operation was aborted.

WS_E_OPERATION_TIMED_OUT

The operation did not complete within the time allotted.

E_OUTOFMEMORY

Ran out of memory.

E_INVALIDARG

One or more arguments are invalid.

Other Errors

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

Minimum supported client

Windows 7 [desktop apps only]

Minimum supported server

Windows Server 2008 R2 [desktop apps only]

Header

WebServices.h

Library

WebServices.lib

DLL

WebServices.dll

 

 

Community Additions

ADD
Show: