Posted: Tue Oct 10, 2006 8:03 am
nuSoaps expects soap:Body elements (standard conform). But http://api.google.com/GoogleSearch.wsdl contains soap:body.
quick&dirty fix:
In nuSoap.php find function start_element($parser, $name, $attrs).
nowis working as expected.
quick&dirty fix:
In nuSoap.php find function start_element($parser, $name, $attrs).
Code: Select all
// get element prefix
if(strpos($name,':')){
// get ns prefix
$prefix = substr($name,0,strpos($name,':'));
// get unqualified name
$name = ucfirst(substr(strstr($name,':'),1)); // ucfirst, quick&dirty hack
}
// set statusnow
Code: Select all
require 'nuSoap.php';
$soapclient = new SoapClient('http://api.google.com/GoogleSearch.wsdl', true);
$params = array(
'key'=>'...',
'q'=>'devnet',
'start'=>0,
'maxResults'=>10,
'filter'=>false,
'restrict'=>'',
'safeSearch'=>false,
'lr'=>'',
'ie'=>'utf-8',
'oe'=>'utf-8'
);
$queryResult = $soapclient->call('doGoogleSearch', $params);
echo '<pre>'; print_r($queryResult); echo '</pre>';