4.3 Performing an Update Search and Consuming Results

This example shows a sequence of messages used to perform an update search and to retrieve the title of the first update found. (This can be generalized to enumerate other properties and to access the remaining updates found.)

  1. The client calls the IUpdateSession::CreateUpdateSearcher (opnum 13) (section 3.16.4.4) method. The server responds with an IUpdateSearcher instance.

  2. The client calls the IUpdateSearcher::ServiceID (opnum 25) (section 3.38.4.16) method (a put property accessor) and passes the identity of the update service against which the update search is to be invoked.

  3. The client calls the IUpdateSearcher::Search (opnum 20) (section 3.38.4.11) method with a string describing the set of updates to search for. The server performs the update search and responds with an ISearchResult instance.

  4. The client calls the ISearchResult::ResultCode (opnum 8) (section 3.14.4.1) method (a get property accessor). The server responds with a result code indicating the result of the search. For the purposes of this example, assume that the search succeeds.

  5. The client calls the ISearchResult::Updates (opnum 10) (section 3.14.4.3) method (a get property accessor). The server responds with an IUpdateCollection instance containing the updates found during the search. For the purposes of this example, assume that the collection contains one or more updates.

  6. The client calls the IUpdateCollection::Item (opnum 8) (section 3.22.4.1) method (a get property accessor), passing the index of the desired update within the collection. The server responds with an IUpdate instance representing the update desired.

  7. The client calls the IUpdate::Title (opnum 8) (section 3.20.4.1) method (a get property accessor). The server responds with a string containing the title of the update.

Message sequence diagram for performing an update search and processing search results

Figure 5: Message sequence diagram for performing an update search and processing search results