Доброго времени суток! У меня тут 2 класса, которые поставляют веб-сервисы и я хочу сделать так, чтоб для этих двух классов работал один SoapServer, один SoapClient, и был один wsdl файл. Логично сделать так: $server->setClass("Class1"); $server->setClass("Class2"); $server->handle(); но дело в том, что как только я добавляю Class2, функции Class1 перестают работать, и я получаю ошибку в клиенте при их вызове. Предположительно тут дело в namespace-ах, и наверное можно решить проблему, если правильно их использовать. Может у кого-то есть идеи? Вот код сервера - server.php: Код (Text): $server = new SoapServer("bla.wsdl"); $server->setClass("Class1"); $server->setClass("Class2"); $server->handle(); class Class1 { public function pow2($a) { return $a * $a; } public function pow3($a) { return $a * $a * $a; } } class Class2 { public function pow4($a) { return $a * $a * $a * $a; } } Это клиент client.php: Код (Text): $client = new SoapClient("bla.wsdl"); echo "2 ^ 2 = " . $client->pow2(2) . "\n"; echo "2 ^ 3 = " . $client->pow3(2) . "\n"; echo "2 ^ 4 = " . $client->pow4(2) . "\n"; И это wsdl - bla.wsdl Код (Text): <?xml version ='1.0' encoding ='UTF-8' ?> <definitions xmlns:class1Ns='http://example.org/Class1' xmlns:class2Ns='http://example.org/Class2' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/' xmlns='http://schemas.xmlsoap.org/wsdl/'> <message name='pow2Request'> <part name='number' type='xsd:float'/> </message> <message name='pow2Response'> <part name='result' type='xsd:float'/> </message> <message name='pow3Request'> <part name='number' type='xsd:float'/> </message> <message name='pow3Response'> <part name='result' type='xsd:float'/> </message> <message name='pow4Request'> <part name='number' type='xsd:float'/> </message> <message name='pow4Response'> <part name='result' type='xsd:float'/> </message> <portType name='Class1PortType'> <operation name='pow2'> <input message='class1Ns:pow2Request'/> <output message='class1Ns:pow2Response'/> </operation> <operation name='pow3'> <input message='class1Ns:pow3Request'/> <output message='class1Ns:pow3Response'/> </operation> </portType> <portType name='Class2PortType'> <operation name='pow4'> <input message='class2Ns:pow4Request'/> <output message='class2Ns:pow4Response'/> </operation> </portType> <binding name='Class1Binding' type='class1Ns:Class1PortType'> <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/> <operation name='pow2'> <soap:operation soapAction='urn:pow2'/> <input> <soap:body use='literal'/> </input> <output> <soap:body use='literal'/> </output> </operation> <operation name='pow3'> <soap:operation soapAction='urn:pow3'/> <input> <soap:body use='literal'/> </input> <output> <soap:body use='literal'/> </output> </operation> </binding> <binding name='Class2Binding' type='class2Ns:Class2PortType'> <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/> <operation name='pow4'> <soap:operation soapAction='urn:pow4'/> <input> <soap:body use='literal'/> </input> <output> <soap:body use='literal'/> </output> </operation> </binding> <service name='Class1AndClass2Service'> <port name='Class1Port' binding='class1Ns:Class1Binding'> <soap:address location='http://localhost/collision/server.php'/> </port> <port name='Class2Port' binding='class2Ns:Class2Binding'> <soap:address location='http://localhost/collision/server.php'/> </port> </service> </definitions> Получается, что если откомментировать строку $server->setClass("Class2"); в server.php, то первые два вызова функций: echo "2 ^ 2 = " . $client->pow2(2) . "\n"; echo "2 ^ 3 = " . $client->pow3(2) . "\n"; будут работать. Ну и понятно, третий вызов даст ошибку. А если закомментить $server->setClass("Class1"); и поставить на первое место в клиенте вызов $client->pow4(2), то этот вызов будет работать, а остальные нет. То есть получается, что если использовать setClass(), то на сервере сможет работать только один класс, а мне необходимо, чтобы их было несколько на одном и том же SoapServer-е... Уже столько ночей ушло на поиски решения и столько документации напрочитано, но ни фи**. Вот по форумам скитаюсь. Помогите пожалста люди добрые!!