Web Services at Work: Google Web APIs (1/2) - exploring XML
Web Services at Work: Google Web APIs
A lot of hype is buzzing around Web Services these days. New acronyms are appearing every day and protocols and tools are implemented at break-neck speed; but not many real applications are publicly available up to now.
Search engine Google makes the leap now and offers the Google Web APIs in a free beta program. Citing the FAQ, "The service gives you query access to Google's Web search, enabling you to develop software that accesses billions of Web documents that are constantly refreshed."
Developers can issue search requests to Google's index programmatically and receive results as structured data, access information in the Google cache, and call the spell-checker. The Google Web APIs have the same search syntax as the Google.com site.
The APIs are for developers that want to use Google as a resource in their applications. Programs can connect remotely to the Google Web APIs service via the Simple Object Access Protocol (SOAP), an XML-based remote procedure call (RPC) mechanism.
Google offers an SDK, which contains some example client Java code, a .NET programming example, and a Web Services Definition Language (WSDL) file describing the Google interface. Google Web APIs are implemented as a Web service. The service supports several SOAP methods; these are described in an accompanying WSDL file that can be imported into your favorite Web services programming environment. Alternately, you can use the custom Java library to call the service.
SOAP and WSDL
The Simple Object Access Protocol defines both a message format and a message exchange model that allows distributed systems to communicate. Other remote procedure call systems such as CORBA are in wide-spread use already, but SOAP combines the ubiquity of HTTP with the openness and momentum of XML.
The Web Services Description Language offers a machine-readable description of a Web service by listing the names and arguments of SOAP-callable functions. The Google service looks like this:
<?xml version="1.0"?> ... <definitions name="urn:GoogleSearch" targetNamespace="urn:GoogleSearch" xmlns:typens="urn:GoogleSearch" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/">
First come the namespace declarations for the subsequent service definitions.
Produced by Michael Claßen
Created: Apr 15, 2002
Revised: Apr 15, 2002