Page 2 of 2

Posted: Tue Oct 10, 2006 8:03 am
by volka
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).

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 status

now

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>';
is working as expected.

Posted: Tue Oct 10, 2006 8:34 am
by malcolmboston
hey, havent really had time to test it but its outputting an array now anyway, that array doesnt look like the one i used to get so i dont know :? anyway dont really have time right now too look into it so ill give ya's a shout if i need anymore help :?

Thanks for the help btw volka, very much appreciated

Posted: Tue Oct 10, 2006 8:39 am
by volka
hm, btw: http://www.w3.org/TR/wsdl#_soap:body[quote]3.5 soap:body[/quote]
seems like soap:Body isn't standard conform after all :roll: