|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51475 setPersistance not possible with setObject
Submitted: 2010-04-05 11:37 UTC Modified: 2013-02-18 00:34 UTC
Avg. Score:4.7 ± 0.7
Reproduced:5 of 5 (100.0%)
Same Version:2 (40.0%)
Same OS:2 (40.0%)
From: jstein at image dot dk Assigned:
Status: No Feedback Package: SOAP related
PHP Version: 5.3.2 OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: jstein at image dot dk
New email:
PHP Version: OS:


 [2010-04-05 11:37 UTC] jstein at image dot dk
In 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: ).


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-04-24 19:14 UTC]
-Status: Open +Status: Feedback
 [2010-04-24 19:14 UTC]
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-24 22:09 UTC] jstein at image dot dk
SOAP server:


class Test{
  private $var;
  function __construct(){
  function addOne(){
    return $this->getVar();

$one=new Test();
$server=new SoapServer(null,array('soap_version'=>SOAP_1_2,'uri'=>""));
//$server->setObject($one); // Does not work
$server->setClass('Test'); // This does work

SOAP Client:

$client = new SoapClient(null, array('location' => "",
                                     'uri'      => "",
                                     '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".
 [2012-01-09 22:18 UTC]
Automatic comment from SVN on behalf of frozenfire
Log: Updated to clarify method's use. Closes bug #60686 and reflects behaviour related to bug #51475. Credit to Rick Bird.
 [2013-02-18 00:34 UTC] php-bugs at lists dot php dot net
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.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Dec 05 09:03:36 2021 UTC