public function soapAction() { $soap = new Soap(null, array('uri' => $this->_WSDL_URI . "/wsdl", 'encoding' => 'UTF-8')); $soap->setClass('\\Application\\Webservices\\gpa'); $soap->setEncoding('UTF-8'); $soap->registerFaultException(array('Exception')); $soap->handle(); return $this->setTerminal(); }
public function testFaultWithRegisteredException() { $server = new Server(); $server->registerFaultException("Exception"); $fault = $server->fault(new \Exception("MyException")); $this->assertTrue($fault instanceof \SOAPFault); $this->assertNotContains("Unknown error", $fault->getMessage()); $this->assertContains("MyException", $fault->getMessage()); }
public function testFaultWithRegisteredException() { $server = new Server(); $server->registerFaultException('\\Zend\\Soap\\Exception\\RuntimeException'); $server->registerFaultException('\\Zend\\Soap\\Exception\\InvalidArgumentException'); $fault = $server->fault(new \Zend\Soap\Exception\RuntimeException('MyException')); $this->assertTrue($fault instanceof \SoapFault); $this->assertNotContains('Unknown error', $fault->getMessage()); $this->assertContains('MyException', $fault->getMessage()); }