Searching Google With The Google API
Executing The Soap Procedure Call
Now that we have our parameters, we can call the SOAP web service. To do this we are using the NuSOAP library.
require_once('nusoap.php'); $soap = new SoapClient('http://api.google.com/GoogleSearch.wsdl', 'wsdl'); $result = $soap->call('doGoogleSearch', $parameters);
Now to explain this:
- The URL of the Google web service is at
- WSDL stands for Web Service Description Language. The WSDL provides a description of how the service works, what procedures it has available, and the parameters required for calling those procedurs. If you visit that URL in your browser, you will a see an XML file description everything about the web service.
- The procedure we’re calling is called
So once you run the
call() function of NuSOAP, the actual request is performed, meaning that Google is now queried for that search term.
The last thing to do now is to handle the results.