The Google research service provides Web research capability with the Google.com search engine from within Microsoft® Office 2003 or Microsoft Internet Explorer.
Installing the research
service
To install the Google research service, follow these steps:
Configure the
research service
Note IIS should be installed before you set up the Microsoft .NET Framework SDK and Microsoft Visual Studio .NET. If you have installed or re-installed IIS after setting up the Microsoft .NET Framework SDK, you will experience unexpected behavior when you try to view ASP.NET pages. To fix this, register ASP.NET with IIS again by running the aspnet_regiis.exe utility. For more information, see Knowledge Base article 306005 , "HOWTO: Repair IIS Mapping After You Remove and Reinstall IIS.”
Configuring the research
service
The Google research service provides a Microsoft Visual C#® and a Microsoft Visual Basic® .NET version. The instructions below use the C# version for illustration. Make necessary adjustments to use the Visual Basic .NET version.
If you have installed the Research SDK on
a computer different from ServerName:
Note To avoid access problems when running running the Google Web service, do not place the GoogleResearchLibraryCSharp folder in the My Documents folder.
Root Folder | Sub Folder | Description |
---|---|---|
\GoogleResearchLibraryCSharp | Root folder for the XML Web service and source code. | |
\bin | Assembly file for the research service. | |
\Web References | Web reference files for the C# Web service project. |
Copy the content of the GoogleResearchLibraryCSharp folder from the computer that the SDK is installed on to the GoogleResearchLibraryCSharp folder on ServerName.
Map the research service folder to a virtual
directory.
To map the research service folder to a virtual directory named GoogleCSharpService on ServerName:
<add key="ServerPath"
value="http://localhost"/>
by changing it to the name of your
server. For example:<add key="ServerPath"
value="http://www.MyServerName.com"/>
Add the research service to the Research
task pane
Before you can search on the Google research service for the first time, you must add the research service to the Research task pane by using the URL http://ServerName/GoogleCSharpService/Registration.asmx. For more information about adding a research service, see Adding Services through the Office User Interface.
The Google research service uses the Google Web APIs, as documented at http://www.google.com/apis/. To access the Google Web APIs, you must create a Google account and obtain a license key from http://www.google.com/apis/. Your Google Account and license key entitle you to 1,000 automated queries per day. There is no charge for this key.
Put your license key assigned to you by Google into the value field:
<add
key="GoogleKey" value="[INSERT YOUR KEY HERE - SEE
README]"/>
For example, this will look like:
<add key="GoogleKey"
value="abc123xyz/abc"/>
Searching the research
service
Searching the Google research service is very similar to searching Google.com. In the Research task pane, under Search for, type the text that you would like to look up. Select Google Web Search (CSharp) as the research service if it has not yet been selected. The Research task pane will then display a list of search results.
Design of the research
service
Under the Search namespace, the Google research service specifies the Web methods: Registration, Query, and Status. The pages http://ServerName/GoogleCSharpService/Registration.asmx and http://ServerName/GoogleCSharpService/Query.asmx provide brief descriptions of each of the methods and hyperlinks to the formal definitons of these methods.
This method is called when you first add the Google research service to the task pane. At that point, it sends a registration request. This method always returns a registration response, and Office then adds this research service to its lists of services. The registration response supports the Microsoft.Search.Registration.Response Schema.
Note that the QueryPath element refers to the location of the Query Web method for this research service at http://ServerName/GoogleCSharpService/Query.asmx.
The bulk of the processing by this solution is handled by the QueryProcessor class. It has the following class structure:
public class QueryProcessor :
System.Web.Services.WebService [WebMethod()]
public string Query(string queryXml)
private string QueryGoogle(string queryString, int startAt)
[WebMethod()] public string Status()
The public function Query that is marked with [WebMethod()] is the other key Web method for this research service. Each request from the client is passed into this function and stored in the queryXml parameter.
The Query function parses queryXml for search terms specified by the user. It then calls the internal method QueryGoogle to continue the search using the Google Web APIs.
After QueryGoogle obtains search results, it puts together and includes the results in a query response that supports the Microsoft.Search.Response Schema. It then passes the query response back to Query.
The Query function returns the query response to the Research task pane. The Research task pane then displays the list of search results.
This method returns the status of the server that hosts the research service.
The Registration and Query Web methods wrap a Registration or Query response into the body of a SOAP message. These methods are specified with the following directive that defines the namespace used for the SOAP message:
<WebService(Namespace:="urn:Microsoft.Search")>
The Research task pane responds only to SOAP messages with this namespace.