Returning Object Through PEAR::SOAP and troubles with php5

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux