PHP interfacing with Google Search problem

A

Anonymous

Guest
Hi im trying to interact with Google's search API through PHP, however this problem keeps cropping up:

Fatal error: Cannot instantiate non-existent class: soapclient in /home/kdz/public_html/backup/search.php on line 41

------------------------------------------------------------------------------------------------------

CODE:

// create an instance of the SOAP client object

line 41 $soapclient = new soapclient("http://api.google.com/search/beta2");

------------------------------------------------------------------------------------------------------

Any ideas? Can I do anything about it?

Thanks :)
 
I already included the soap file. Do I have include any others?

// include the class from NuSoap

include("http://www.kdz.org.mt/soap/lib/nusoap.php");

// create an instance of the SOAP client object

$soapclient = new soapclient("http://api.google.com/search/beta2");
 
include("http://www.kdz.org.mt/soap/lib/nusoap.php");

will not help as it has to be on your server and be a relative address
*sorry for my typo
 
well that is the address of my server and so it is an absolute address if i am correct :S
 
I think it would have to be a relative address rather than an absolute one. How would the address of the include command be?

This is my structure

public_html > soap > lib nusoap.php

public_html > backup > search.php (from where i call nusoap.php)

Thanks
 
hey you need to

Code:
<?php
// search.php
include_once '../soap/lib nusoap.php';
?>
 
Yes thanks that resolved that problem, however I got another one now:


Fatal error: Call to a member function on a non-object in /home/kdz/public_html/backup/search.php on line 80

/* invoke the method on the Google server. The call() method accepts four arguments - name of the remote procedure
to be invoked, an array of arguments for the remote procedure, namespace and SOAP action */

line 80 $MyResult = $soapclient -> call("doGoogleSearch", $params, "urn:GoogleSearch", "urn:GoogleSearch");

:(
 
that's what i thought too, but still doesnt work :(

Fatal error: Call to a member function on a non-object in /home/kdz/public_html/backup/search.php on line 80
 
Back
Top