次の方法で共有


WSDCreateDeviceProxyAdvanced (Compact 2013)

3/26/2014

This function creates a device proxy and returns a pointer to the IWSDDeviceProxy interface.

Syntax

HRESULT WSDCreateDeviceProxy(
  const WCHAR* pszDeviceId,
  IWSDAddress* pDeviceAddress,
  const WCHAR* pszLocalId,
  IWSDXMLContext* pContext,
  IWSDDeviceProxy** ppDeviceProxy
);

Parameters

  • pszDeviceId
    [in] The logical or physical address of the device. A logical address is of the form urn:uuid:{guid}. A physical address is a URI prefixed by http or https. If this address is a URI prefixed by https, then the proxy will use the SSL/TLS protocol.
  • pDeviceAddress
    An IWSDAddress interface that defines the device transport address. When pDeviceAddress is specified, a device proxy can be created without requiring the resolution of a logical address passed to pszDeviceId. This parameter may be NULL.
  • pszLocalId
    [in] The logical or physical address of the client, which is used to identify the proxy and to act as an event sink endpoint. A logical address is of the form urn:uuid:{guid}.

    If the client uses a secure channel to receive events, then the address is a URI prefixed by https. This URI should specify port 5358, as this port is reserved for secure connections with WSDAPI. The port must be configured with an SSL server certificate before calling WSDCreateDeviceProxyAdvanced. For more information about port configuration, see HttpSetServiceConfiguration.

  • pContext
    [in] An IWSDXMLContext object that defines custom message types or namespaces.

    If NULL, a default context representing the built-in message types and namespaces is used.

  • ppDeviceProxy
    [out] Pointer to an IWSDDeviceProxy object that you use to represent a remote DPWS device for client applications and middleware.

Return Value

The following table shows the possible error code return values.

Error Code

Description

S_OK

The function succeeded.

E_INVALIDARG

pszDeviceId is NULL, pszLocalId is NULL, the length in characters of pszDeviceId exceeds WSD_MAX_TEXT_LENGTH (8192), the length in characters of pszLocalId exceeds WSD_MAX_TEXT_LENGTH (8192), or pszDeviceId points to a URI prefixed by https and that URL does not match the URI passed to pszLocalId.

E_POINTER

ppDeviceProxy is NULL.

E_OUTOFMEMORY

Insufficient memory to complete the operation.

Remarks

The WSDCreateDeviceProxyAdvanced function calls the IWSDDeviceProxy::Init method, which initializes an instance of an IWSDDeviceProxy object.

For information about troubleshooting WSDCreateDeviceProxyAdvanced function calls, see this Microsoft Web site.

Requirements

Header

wsdapi.h

Library

wsdapi.lib

See Also

Reference

Web Services on Devices Functions
Web Services on Devices Reference