PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
function getGoogleResults () {
// connect to the soap client
$soapclient = new soapclient("http://api.google.com/GoogleSearch.wsdl","wsdl");
// get back a result
$queryResult = $soapclient->call("doGoogleSearch", $this->searchParameters, "urn:GoogleSearch");
// and on it go's.............................
now ive had this working before but now whenever i send the request i get this cryptic error message:
Array
(
[faultcode] => SOAP-ENV:Server
[faultstring] => Exception while handling service request: com.google.soap.search.GoogleSearchService.doGoogleSearch([none]) not found.
[faultactor] => /search/beta2
[detail] => Array
(
[stackTrace] => java.lang.NoSuchMethodException: com.google.soap.search.GoogleSearchService.doGoogleSearch([none]) not found.
at org.apache.soap.util.MethodUtils.getEntryPoint(MethodUtils.java:134)
at org.apache.soap.util.MethodUtils.getMethod(MethodUtils.java:548)
at org.apache.soap.util.MethodUtils.getMethod(MethodUtils.java:528)
at org.apache.soap.server.RPCRouter.invoke(RPCRouter.java:114)
at org.apache.soap.providers.RPCJavaProvider.invoke(RPCJavaProvider.java:129)
at org.apache.soap.server.http.RPCRouterServlet.doPost(RPCRouterServlet.java:288)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at com.google.gse.HttpConnection.runServlet(HttpConnection.java:436)
at com.google.gse.HttpConnection.run(HttpConnection.java:376)
at com.google.gse.DispatchQueue$WorkerThread.run(DispatchQueue.java:254)
)
)
does anyone know what it means and / or how to solve it
no im not, like i said this exact code worked fine about 2 weeks ago, i actually copied and pasted that element of the code from an existing application i built..... although google can change it at anytime as its in Beta they simply would not change that element as it would likely break thousands of existing applications, in fact my first use of the google API i developed a SEO tool for an old job, i hope it has broke
function getGoogleResults () {
// connect to the soap client
$soapclient = new soapclient("http://api.google.com/GoogleSearch.wsdl","wsdl");
// get back a result
$queryResult = $soapclient->call('doGoogleSearch', $this->searchParameters);
if (empty($queryResult)) {
output::outputWarning('API Failure :: Failed to return a resultset'); // output warning and retry
$results = $this->getResults ();
} else {
return $queryResult;
}
}
ok i got the error message to stop, but now i get a different error message i cant believe tbh im having this many problems with it, ive done this before without a hitch!!
anyway the error message:
Notice: Undefined index: in C:\netserver\www\labs\gQuery\includes\nusoap.php on line 5901
That nusoap file is an absolutely unedited file, total lines is 7241
// the next line is line "5899"
$this->debug('parsed successfully, found root struct: '.$this->root_struct.' of name '.$this->root_struct_name);
// get final value
$this->soapresponse = $this->message[$this->root_struct]['result'];
// get header value: no, because this is documented as XML string
// if($this->root_header != '' && isset($this->message[$this->root_header]['result'])){
// $this->responseHeaders = $this->message[$this->root_header]['result'];
// }
im so baffled my brain is hurting, any ideas anyone?
Notice: Undefined index: in C:\netserver\www\labs\gQuery\includes\nusoap.php on line 5901
string(0) ""
error_reporting (E_ALL) by the way, so does this mean it isnt my code? maybe i have a <span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span> up nusoap file?? ive just downloaded what is supposedly the latest version and it is still doing it?
<?php
error_reporting (E_ALL);
require ('includes/gQuery2.class.php');
require ('includes/nusoap.php');
?>
<?php
$soapclient = new SoapClient('http://api.google.com/GoogleSearch.wsdl');
$apiKey = 'xxx';
$searchphrase = 'devnet';
// the next call is not a valid method
//$queryResult = $soapclient->doGoogleSearch($apiKey, $searchphrase, 0, 10, False, '', False, '', 'utf-8', "utf-8");
// so i do this, which ive always done, and worked fine before
$queryResult = $soapclient->call($apiKey, $searchphrase, 0, 10, False, '', False, '', 'utf-8', "utf-8");
var_dump($queryResult);?>