How to using SoapClient in php5 with google api

hi,

i want to using google search api
i have license key but when i using this

$client = new SoapClient("http://api.google.com/search/beta2");
$faxResult = $client->SendCharFax(array(
        "key"        => 'keyhere',
        "q"           => 'test',                 
        "start"       => '0',
        "maxResults"  => '10',
        "filter"      => true,
        "restrict"    => "",
        "safeSearch"  => true,
        "lr"          => "lang_en",
        "ie"          => "",
        "oe"          => ""
));

print_r($faxResult);

i get this error

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://api.google.com/search/beta2' : Extra content at the end of the document in /home/arabsb5/public_html/soft/test.php:13 Stack trace: #0 /home/**/public_html/**/test.php(13): SoapClient->SoapClient('http://api.goog...') #1 {main} thrown in /home/**/public_html/**/test.php on line 13

what should i do :rolleyes:

http://api.google.com/search/beta2

Is not a valid WSDL, which is what your require for the SoapClient to function correctly. Unfortunately, Google appears to have ceased to provide this service.

You could always look to consume Google’s AJAX API which provides a json encoded response.

http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q={QUERY}

More information here.