Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Building Web services applications with the Google API

Nicholas Chase, Author, Web site developer
Nicholas Chase has been involved in Web site development for companies such as Lucent Technologies, Sun Microsystems, Oracle, and the Tampa Bay Buccaneers. Nick has been a high school physics teacher, a low-level radioactive waste facility manager, an online science fiction magazine editor, a multimedia engineer, and an Oracle instructor. More recently, he was the Chief Technology Officer of Site Dynamics Interactive Communications in Clearwater, Florida, and is the author of three books on Web development, including Java and XML From Scratch (Que) and the upcoming Primer Plus XML Programming (SAM). He loves to hear from readers and can be reached at nicholas@nicholaschase.com.

Summary:  The Google search engine can now be accessed via a SOAP-based Web service. This means that developers can now embed Google search results and other information into their own applications. Google also took this project one step further, creating an API and Java toolkit for accessing the data. This tutorial is for developers who want to use Google information from within their Java applications.

Date:  15 May 2002
Level:  Intermediate PDF:  A4 and Letter (109 KB | 32 pages)Get Adobe® Reader®

Activity:  8946 views
Comments:  

Introduction

Should I take this tutorial?

The Google search engine can now be accessed via a SOAP-based Web service. This means that developers can now embed Google search results and other information into their own applications. Google also took this project one step further, creating an API and Java technology toolkit for accessing the data. This tutorial is for developers who want to use Google information from within their Java applications.

Developers need to be familiar with Java programming language, and will need an Internet connection to access the Google service. An understanding of Web services is not required to use the API.

What is this tutorial about?

Interest in Web services is booming, and now there is a practical application for them accessible to those outside large enterprise environments. Google has lately become the most popular search engine on the Web, and now they have made their index of 2 billion pages available to developers via a SOAP-based API in order to enable applications such as new content watchdogs, GUI search tools, and pattern analysis.

The Google API enables you to perform searches, retrieve cached pages from Google, and utilize Google's spell-checking capabilities. All of these capabilities can then be integrated into any application in an environment that supports Web services.

This tutorial demonstrates the creation of four separate applications:

  • The first sends a search query to the Web service and retrieves and analyzes the individual and aggregated results using only Java skills.
  • The second application retrieves a specific Web page from the Google cache.
  • The third demonstrates Google's spelling suggestion capabilities.
  • The last part of the tutorial discusses the different SOAP messages used by the Web service, and the process of sending them directly to the Google Web service. This fourth application uses JAXM to send and receive the messages, which are then transformed into useful results.

Tools

Make sure that the following tools are installed and tested before beginning the tutorial.

  • Java 2 SDK, Standard Edition version 1.3.1 or higher: The sample applications demonstrate manipulation of the DOM through Java technology. You can download the Java SDK from http://java.sun.com/j2se/.
  • The Google API, available at http://www.google.com/apis/.
  • The last section of this tutorial deals with sending SOAP messages directly, rather than through the API. To run these samples, you'll need the Java API for XML Mess aging, or JAXM. It's available as part of the Java XML Pack, at http://java.sun.com/xml/downloads/javaxmlpack.html.

1 of 10 | Next

Comments



Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=SOA and Web services
ArticleID=137338
TutorialTitle=Building Web services applications with the Google API
publish-date=05152002
author1-email=
author1-email-cc=

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Try IBM PureSystems. No charge.