In PHP I would like to know what will be the method called by SOAP. Here is a sample to understand...
$soapserver = new SoapServer();
$soapserver->setClass('myClass');
$soapserver->handle();
What I would like to know is the name of the method that will be executed in handle()
Thank you !!
In my opinion, the cleanest and most elegant way to access the called operation's name in this situation would be using some kind of Wrapper or Surrogate design pattern. Depending on Your intent You would use either the Decorator or the Proxy.
As an example, let's say We want to dynamically add some additional functionality to our
Handler
object without touching the class itself. This allows for keeping theHandler
class cleaner and, thus, more focused on its direct responsibility. Such functionality could be logging of methods and their parameters or implementing some kind of caching mechanism. For this We will use the Decorator design pattern. Instead of doing this:We'll do the following:
If You want to control the access to the Handler's operations, for instance, in order to impose access rights use the Proxy design pattern.