IWSDDeviceHost interface (wsdhost.h)

Represents a DPWS-compliant device . The device host will announce its presence on the network using the WS-Discovery protocol. The device host will also automatically respond to discovery queries and metadata requests.

The caller can register user-implemented services with the device host. These services will be exposed in the device metadata and the services will be available over the network. Messages bound for these services will be automatically dispatched into the service object.

Call WSDCreateDeviceHost or WSDCreateDeviceHostAdvanced to create an object that exposes this interface.

Inheritance

The IWSDDeviceHost interface inherits from the IUnknown interface. IWSDDeviceHost also has these types of members:

Methods

The IWSDDeviceHost interface has these methods.

 
IWSDDeviceHost::AddDynamicService

Registers a service object for incoming requests, but does not add the service to the device host metadata. This is used for transient (dynamic) services.
IWSDDeviceHost::Init

Initializes an instance of an IWSDDeviceHost object.
IWSDDeviceHost::RegisterPortType

Registers a port type for incoming messages.
IWSDDeviceHost::RegisterService

Registers a service object for incoming requests and adds the service to the device host metadata.
IWSDDeviceHost::RemoveDynamicService

Unregisters a service object that was registered using AddDynamicService.
IWSDDeviceHost::RetireService

Unregisters a service object that was registered using RegisterService and removes the service from the device host metadata.
IWSDDeviceHost::SetMetadata

Sets the metadata for a device, excluding user-defined service metadata.
IWSDDeviceHost::SetServiceDiscoverable

Controls whether or not the service is advertised using WS-Discovery.
IWSDDeviceHost::SignalEvent

Notifies all subscribed clients that an event has occurred.
IWSDDeviceHost::Start

Starts the device host and publishes the device host using a WS-Discovery Hello message.
IWSDDeviceHost::Stop

Sends a WS-Discovery Bye message and stops the host.
IWSDDeviceHost::Terminate

Terminates the host and releases any attached services.

Remarks

After retrieving this interface, the application would then:

  1. Call the RegisterPortType method to register all necessary port types.
  2. Call SetMetadata to describe the device and optionally call RegisterService one or more times to register services described in the service host metadata.
  3. Call the Start method to start the device host and to publish the device using WS-Discovery.After starting the device host, you can optionally:
    1. Call AddDynamicService for services not described in the service host metadata (for example, an ad hoc print job).
    2. Call RetireService to terminate action on and disconnect a service activated by the RegisterService method.
    3. Call the SignalEvent method to indicate that notifications should be sent for subscriptions relating to a particular event.
  4. Call the Stop method to terminate host execution and terminate publication of the device.

An IWSDDeviceHost object can provide an object for a service on demand (using a notification callback) when calling the host receives a request message directed at that service.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header wsdhost.h (include Wsdapi.h)

See also

Overview of the WSDAPI Interfaces