Prev | Current Page 749 | Next

Rob Cameron and Dale Michalk

"Pro ASP.NET 3.5 Server Controls and AJAX Components"

CreateChannel();
SearchRequest searchRequest = new SearchRequest();
//Set mark query word. Allows developer to highlight as desired
searchRequest.Flags = SearchFlags.DisableHostCollapsing |
SearchFlags.MarkQueryWords;
searchRequest.Query = query;
if (sourceRequests != null)
searchRequest.Requests = sourceRequests;
searchRequest.AppID = LiveSearchLicenseKey;
searchRequest.CultureInfo = "en-US";
SearchResponse searchResponse = searchService.Search(searchRequest);
return searchResponse;
CHAPTER 12 ?–  BUILDING A COMPLEX CONTROL 581
The internal implementation is not as important as understanding the types that are
passed into the web service. The Search method takes a SearchRequest object as its sole parameter,
which is configured with the search query string on its Query property. The SearchRequest
object has a Requests property that takes an ArrayList of one or more SourceRequest objects.
Each SourceRequest represents a search query, so it is possible to perform multiple searches in
a single web service method call on MSNSearchPortType.Search. Configuring the SourceRequest
object is the first step in performing a search request. Table 12-1 provides an explanation of the
properties that can be configured on a SourceRequest object.


Pages:
737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761