From:             
Operating system: Linux 2.6.26
PHP version:      5.2.13
Package:          SOAP related
Bug Type:         Bug
Bug description:SoapServer with a extented class and using sessions, lost the 
setPersistence()

Description:
------------
A SoapServer using sessions and extending some class included by require or


include functions, lose the persistence seted by setPersistence 

(SOAP_PERSISTENCE_SESSION)



The script below will work fine with one of 3 changes (no idea why):



- Declaring the class "Server2" in the same file as class "Server"
(Server1.php) 

and removing the require_once(Server2.php);



- Removing the "session_start();" from server.php



- If class "Server" do no extend any class, it also works.



Thanks a lot!



Test script:
---------------
## Client.php ##

<?php 

$cli = new SoapClient(null, array('location' =>
"http://localhost:81/bugTest/Server.php";, 'uri' =>
"blablabla.com",'encoding' => "ISO-8859-1",'soap_version' => SOAP_1_2));

$cli->setValue(100);

$response = $cli->getValue();

echo "Get = ".$response;        

?>



## Server.php ##

<?php 

session_start();

require_once("Server2.php");

class Server extends Server2 {

        private $value;

        public function setValue($param) { $this->value = $param; }

        public function getValue() { return $this->value; }

}

$server = new SoapServer(null, array('uri' => "blablabla.com",'encoding' =>
"ISO-8859-1",'soap_version' => SOAP_1_2));

$server->setClass("Server");

$server->setPersistence(SOAP_PERSISTENCE_SESSION);

$server->handle();

?>



## Server2.php ##

<?php class Server2{ private $nothing; } ?>

Expected result:
----------------
Get = 100

Actual result:
--------------
Get = 

-- 
Edit bug report at http://bugs.php.net/bug.php?id=51561&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=51561&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=51561&r=trysnapshot53
Try a snapshot (PHP 6.0):            
http://bugs.php.net/fix.php?id=51561&r=trysnapshot60
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=51561&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=51561&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=51561&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=51561&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=51561&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=51561&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=51561&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=51561&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=51561&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=51561&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=51561&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=51561&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=51561&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=51561&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=51561&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=51561&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=51561&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=51561&r=mysqlcfg

Reply via email to