|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-04-07 15:41 UTC] 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'));
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 00:00:01 2025 UTC |
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'));