IWSDiscoveryProvider::SearchByType (Windows Embedded CE 6.0)

1/6/2010

This method initializes a search for WS-Discovery hosts by device type.

Syntax

HRESULT SearchByType(
  WSD_NAME_LIST* pTypesList,
  WSD_URI_LIST* pScopesList,
  LPCWSTR pszMatchBy,
  LPCWSTR pszTag
);

Parameters

  • pTypesList
    [in, optional] List of discovery provider types to search for. May be NULL.
  • pScopesList
    [in, optional] List of discovery provider scopes to search for. May be NULL.
  • pszMatchBy
    [in, optional] Matching rule used for scopes. May be NULL.
  • pszTag
    [in, optional] Optional identifier tag for this search. May be NULL.

Return Value

The following table shows the possible error code return values.

Error code Description

S_OK

This method completed successfully.

E_INVALIDARG

The length in characters of pszMatchBy exceeds WSD_MAX_TEXT_LENGTH (8192) or the length in characters of pszTag exceeds WSD_MAX_TEXT_LENGTH (8192).

E_ABORT

A callback interface has not been attached. IWSDiscoveryProvider::Attach must be called before calling this method.

E_OUTOFMEMORY

Not enough memory exists to perform the operation.

Remarks

SearchByType initiates a WS-Discovery Probe in an attempt to locate discovery hosts matching the provided criteria. This method allows matching by types, scopes, some combination of the two, or matching all discovery capable devices (when no scopes or types are provided). pszMatchBy should be provided if and only if pScopesList is also provided. This call may result in one or more IWSDiscoveryProviderNotify::Add callbacks. If any Add callbacks are issued before the search completes, a IWSDiscoveryProviderNotify::SearchComplete callback will be issued; otherwise, a IWSDiscoveryProviderNotify::SearchFailed callback will be issued.

pszTag is an optional user provided string which will be fed back in either callback, allowing the caller to associate the callback with the original query.

For information about troubleshooting applications calling this method, see this Microsoft Web site.

Requirements

Header wsdapi.h
Library wsdapi.lib
Windows Embedded CE Windows Embedded CE 6.0 R2

See Also

Reference

IWSDiscoveryProvider
Web Services on Devices Interfaces