ID: 44267 Comment by: glenn at webmind dot be Reported By: falk dot herrmann at bike24 dot net Status: Open Bug Type: SOAP related Operating System: Linux 2.6.23 PHP Version: 5.2.5 New Comment:
Having the same problem here. Previous Comments: ------------------------------------------------------------------------ [2008-04-20 16:17:34] davy dot defaud at free dot fr I experienced the same problem on the same version 5.2.5, for a 2.6.24 kernel both on a i586 and a x86_64 systems (but I don't think it's system related). I already had this problem with an old 5.0.4 PHP but my code was working on a 5.2.1 including Suhosin so I was confident that it would work on my brand new mandriva 2008.1 server with the latest PHP, but it doesn't :-( This is a really critical bug for those using PHP as a SOAP server. We really need a quick fix. ------------------------------------------------------------------------ [2008-02-27 14:25:18] falk dot herrmann at bike24 dot net Description: ------------ A soap server with SOAP_PERSISTENCE_SESSION is not persistence if the class Bar extends class Foo and the class Foo was included via include() or required(). If the class Foo is directly in the server code file (server.php), soap server works correct. Reproduce code: --------------- server.php ========== <?php session_name('PSESSION'); if ( $_COOKIE['PSESSION'] ) { session_id($_COOKIE['PSESSION']); } $res = session_start(); require('Foo.php'); class Bar extends Foo { public $var = 0; public function login() { return session_id(); } public function incVar() { $this->var++; return $this->var; } } $server = new SoapServer(NULL, array('uri' => 'http://localhost/')); $server->setClass('Bar'); $server->setPersistence(SOAP_PERSISTENCE_SESSION); $server->handle(); ?> client.php ========== <?php # Soap client $client = new SoapClient(NULL, array( "location" => "http://localhost/server.php", "uri" => "urn:xmethodsTest", 'trace' => 1 )); # SOAP requests try { $session = $client->login(); $client->__setCookie('PSESSION', $session); print $client->incVar(); print "\n"; print $client->incVar(); print "\n"; print $client->incVar(); print "\n"; print $client->incVar(); print "\n"; print $client->incVar(); print "\n"; } catch (SoapFault $sf) { # ... } ?> Foo.php ======= <?php class Foo { } ?> Expected result: ---------------- 1 2 3 4 5 Actual result: -------------- 1 1 1 1 1 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=44267&edit=1