Returning Object Through PEAR::SOAP and troubles with php5
| From: | SirLancelot | Date: | Mon, 29 Dec 2003 14:53:28 +0000 |
| Subject: | Returning Object Through PEAR::SOAP and troubles with php5 | ||
| Groups: | php.soap | ||
| Request: | Send a blank email to php-soap+get-1273@lists.php.net to get a copy of this message | ||
Hi guys,
i'm an italian PHP developer, and i'm trying to improve my knowledge about
web services.
First I want to know if it is possible in any way to return objects from a
php pear::soap server.
I'm experimenting php5 too, so I tried to convert some work, and I found a
big problem with PEAR::SOAP 0.7.5 and php5.0.0b3:
System: Windows XP/Apache 1.3.29/PHP5.0.0b3/MySQL 4.0.1/
PEAR VERSIONS:
PEAR-BASE-1.2.1 - PEAR-SOAP 0.7.5
I exposed as web service the following method of a class:
function dbGetOne($id)
{
if(!is_numeric($id))
return "wrong ID passed!";
$dsn = array(
"phptype"=>"mysql",
"hostspec"=>"myhost",
"database"=>"mydb",
"username"=>"myuser",
"password"=> "mypassword"
);
$db = DB::connect($dsn);
$query="SELECT * FROM actions WHERE ID=". $id;
$result = $db->query($query);
if($row=$result->fetchRow(DB_FETCHMODE_ASSOC))
return $row;
else
return "no data found for record: ".$id;
}
in php4.3.4 this method works fine, but in php5 I got this fatal error:
Trying to reference a non valid object: libs/PEAR/SOAP/Client.php on line
582
that is: return array_shift($returnArray)
Thanks in advance for your help!!
Greeting and wishes of happy new year :)
Giorgio from Rome