ID: 47919 User updated by: e dot sand at elisand dot com Reported By: e dot sand at elisand dot com Status: Open Bug Type: Feature/Change Request Operating System: Irrelevant PHP Version: 5.2.9 New Comment:
Apologies for the possible confusion in an obvious typo in the code examples - I used "setQuantity" instead of my example function named "fun"). The actual example code should be: class SOAPMethods { public static function fun() {...} } $server = New SoapServer(...); $server->setObject($myobject); // this overwrites the exporting of $myobject above. $server->setClass('SOAPMethods'); // this method also doesn't work (should, as of PHP5.2.3) $server->addFunction('SOAPMethods::fun'); // neither does this syntax for accessing class functions $server->addFunction(array('SOAPMethods', 'fun')); // neither does this syntax for accessing class functions $methods = new SOAPMethods; $server->addFunction(array(&$methods, 'fun')); Previous Comments: ------------------------------------------------------------------------ [2009-04-07 15:41:45] e dot sand at elisand dot com Description: ------------ It is currently impossible (so it seems) to *add* a class of functions to SoapServer for handling. The call to setClass() or setObject() overwrite the entire exported function list, so if you wish to try and add multiple classes containing functions to the SoapServer, it is not possible. Introducing a new addClass() (I don't think exporting multiple objects through a new addObject() call would make viable sense though) that would allow *appending* additional functions to the exported function list for SoapServer would resolve this problem. Additionally or alternatively, addFunction() could be modified to allow accessing class functions as well. Currently it is impossible to export any class functions to the SoapServer by using addFunction(). Reproduce code: --------------- class SOAPMethods { public static function fun() {...} } $server = New SoapServer(...); $server->setObject($myobject); // this overwrites the exporting of $myobject above. $server->setClass('SOAPMethods'); // this method also doesn't work (should, as of PHP5.2.3) $server->addFunction('SOAPMethods::setQuantity'); // neither does this syntax for accessing class functions $server->addFunction(array('SOAPMethods', 'setQuantity')); // neither does this syntax for accessing class functions $methods = new SOAPMethods; $server->addFunction(array(&$methods, 'setQuantity')); ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=47919&edit=1