#35972 [Opn->Fbk]: Not able to use a class in a persistence session
| From: | tony2001@php.net | Date: | Wed, 11 Jan 2006 15:44:53 +0000 |
| Subject: | #35972 [Opn->Fbk]: Not able to use a class in a persistence session | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-91771@lists.php.net to get a copy of this message | ||
ID: 35972
Updated by: tony2001@php.net
Reported By: ckl at ecw dot de
-Status: Open
+Status: Feedback
Bug Type: SOAP related
Operating System: Win32
PHP Version: 5.1.1
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.1-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.1-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2006-01-11 16:43:08] ckl at ecw dot de
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 this bug report at http://bugs.php.net/?id=35972&edit=1