Edit report at https://bugs.php.net/bug.php?id=51475&edit=1
ID: 51475 Updated by: php-bugs@lists.php.net Reported by: jstein at image dot dk Summary: setPersistance not possible with setObject -Status: Feedback +Status: No Feedback Type: Bug Package: SOAP related PHP Version: 5.3.2 New Comment: No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Open". Thank you. Previous Comments: ------------------------------------------------------------------------ [2012-01-09 22:18:49] frozenf...@php.net Automatic comment from SVN on behalf of frozenfire Revision: http://svn.php.net/viewvc/?view=revision&revision=321972 Log: Updated to clarify method's use. Closes bug #60686 and reflects behaviour related to bug #51475. Credit to Rick Bird. ------------------------------------------------------------------------ [2010-04-24 22:09:03] jstein at image dot dk SOAP server: <?php class Test{ private $var; function __construct(){ $this->var=0; } function addOne(){ $this->var++; return $this->getVar(); } } $data=$HTTP_RAW_POST_DATA; $one=new Test(); session_start(); $server=new SoapServer(null,array('soap_version'=>SOAP_1_2,'uri'=>"http://jsp-hotel.dk/test")); //$server->setObject($one); // Does not work $server->setClass('Test'); // This does work $server->setPersistence(SOAP_PERSISTENCE_SESSION); $server->handle($data); ?> SOAP Client: <?php $client = new SoapClient(null, array('location' => "http://jsp-hotel.dk/test/soappersistence-setClass.php", 'uri' => "http://jsp-hotel.dk/test", 'trace' => true)); try { echo $client->addOne(); echo '<hr>'; echo $client->addOne(); } catch (Exception $e) { echo $e . '<hr>'; echo $client->__getLastRequest() . '<hr>' . $client->__getLastRequestHeaders() . '<hr>' . $client->__getLastResponse() . '<hr>' . $client->__getLastResponseHeaders(); } ?> The client prints 1 2 (as expected) when server uses "setClass", but 1 1 when server uses "setObject". ------------------------------------------------------------------------ [2010-04-24 19:14:41] fel...@php.net Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. ------------------------------------------------------------------------ [2010-04-05 11:37:34] jstein at image dot dk Description: ------------ In http://svn.php.net/viewvc/php/php-src/trunk/ext/soap/soap.c?revision=296820&view=markup at line 1322 "setPersistence" checks for "service->type == SOAP_CLASS", but if you want to set an object with "setObject" instead of a class, the service type will be SOAP_OBJECT. I guess it should be possible to use persistence with setObject (that's what the documentation says: http://www.php.net/manual/en/soapserver.setpersistence.php ). ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=51475&edit=1