WsCloseServiceProxy function (webservices.h)
Closes down communication with the specified service proxy.
Syntax
HRESULT WsCloseServiceProxy(
[in] WS_SERVICE_PROXY *serviceProxy,
[in, optional] const WS_ASYNC_CONTEXT *asyncContext,
[in, optional] WS_ERROR *error
);
Parameters
[in] serviceProxy
Pointer to a WS_SERVICE_PROXY structure representing he service proxy to be closed.
[in, optional] asyncContext
Pointer to a WS_ASYNC_CONTEXT structure containing information for invoking the function asynchronously. Pass NULL to invoke the function synchronously.
[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 |
---|---|
|
The asynchronous operation is still pending. |
|
The current state of the service proxy is not valid for this operation. This is only error for which close will fail. |
|
The underlying WS_CHANNEL was disconnected during the close operation. This error occurs only in cases where the underlying channel is session based. |
|
The operation was aborted. |
|
The remote endpoint could not process the request. |
|
The input data was not in the expected format or did not have the expected value. |
|
The operation did not complete within the time allotted. |
|
A quota was exceeded. |
|
Insufficient memory to complete the operation. |
|
One or more arguments are invalid. |
|
This function may return other errors not listed above. |
Remarks
If a service operation call is pending on the service proxy, WsCloseServiceProxy waits for each call to complete. After calling WsCloseServiceProxy application should not perform any more calls on the service proxy.
Note that WS_E_INVALID_OPERATION is the only
error code that indicates that closure has failed. Other error codes indicate that the operation succeeded, and the error code is for informational purposes only.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 7 [desktop apps | UWP apps] |
Minimum supported server | Windows Server 2008 R2 [desktop apps | UWP apps] |
Target Platform | Windows |
Header | webservices.h |
Library | WebServices.lib |
DLL | WebServices.dll |