Is that possible to have a single PHP SOAP server which will handle requests to several classes (services)?
If yes, could you please show an example implementation?
If not, could you please describe why?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Could you wrap the other services in a single class? Completely untested, it was just a thought…
class MySoapService { public function __construct() { $this->_service1 = new Service1(); $this->_service2 = new Service2(); } // You could probably use __call() here and intercept any calls, // thus avoiding the need for these declarations in the wrapper class... public function add($a, $b) { return $this->_service1->add($a, $b); } public function sub($a, $b) { return $this->_service2->sub($a, $b); } } class Service1 { public function add($a, $b) { return $a + $b; } } class Service2 { public function sub($a, $b) { return $a - $b; } }