|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35972 Not able to use a class in a persistence session
Submitted: 2006-01-11 16:43 UTC Modified: 2006-01-13 10:58 UTC
From: ckl at ecw dot de Assigned: dmitry (profile)
Status: Not a bug Package: SOAP related
PHP Version: 5CVS-2006-01-11 (5.1.2) (snap) OS: Win32
Private report: No CVE-ID: None
 [2006-01-11 16:43 UTC] ckl at ecw dot de
I get a strange problem when creating a web-service. The second call on the web-service crashes.

Reproduce code:

  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');

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"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-01-12 09:12 UTC]
Could you please provide full example with client, server, "Log5.php" and 'SOAPSMSServer.wsdl'.

I created my own test-case, but it works fine for me.
 [2006-01-12 09:30 UTC] ckl at ecw dot de
The four files are located in
Thanks in advance,
Christopher Klein
 [2006-01-13 09:18 UTC]
You should include files with class definition before starting session.

The following modification makes it works fine


 [2006-01-13 10:58 UTC] ckl at ecw dot de
Thank you for your reply, but this change just fixes ONE error message.
Plase remove the comment-signs from LogHandler.php5 in method callLogHandler (throw new Exception...) and you will see, that  the class has lost the whole content of the property $instancesLog between the __construct(), method1() and method2().
Any ideas?
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Oct 23 09:03:33 2021 UTC