#35972 [NEW]: Not able to use a class in a persistence session
| From: | ckl at ecw dot de | Date: | Wed, 11 Jan 2006 15:43:09 +0000 |
| Subject: | #35972 [NEW]: Not able to use a class in a persistence session | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-91770@lists.php.net to get a copy of this message | ||
From: ckl at ecw dot de
Operating system: Win32
PHP version: 5.1.1
PHP Bug Type: SOAP related
Bug description: Not able to use a class in a persistence session
Description:
------------
I get a strange problem when creating a web-service. The second call on
the web-service crashes.
Reproduce code:
---------------
<?php
include_once("Log.php5);
class SOAPSMSServer
{
function __construct() {
$this->objLog = new Log();
}
public function method1() {
$this->objLog->log("Method 1 called");
}
public function method2() {
$this->objLog->log("Method 2 called"); // << crashes
}
$soapServer = new SoapServer('SOAPSMSServer.wsdl');
$soapServer->setClass('SOAPSMSServer');
$soapServer->addFunction(array('method1','method2'));
$soapServer->setPersistence(SOAP_PERSISTENCE_SESSION);
$soapServer->handle();
?>
Expected result:
----------------
In my opinion the script should do following:
a) Client connects to SOAP-Server
b) Server executes __construct()
c) Server executes method1()
calls the log-method
d) Server executes method2()
calls the log-method
The client is ok - it works if I disable logging.
Actual result:
--------------
The error is:
"The script tried to execute a method or access a property of an
incomplete object. Please ensure that the class definition "Log" of the
object you are trying to operate on was loaded _before_ unserialize() gets
called or provide a __autoload() function to load the class definition"
--
Edit bug report at http://bugs.php.net/?id=35972&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=35972&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=35972&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=35972&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=35972&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=35972&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=35972&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=35972&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=35972&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=35972&r=support
Expected behavior: http://bugs.php.net/fix.php?id=35972&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=35972&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=35972&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=35972&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35972&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=35972&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=35972&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=35972&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=35972&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=35972&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=35972&r=mysqlcfg