/** * Actual "do request" method. * * @internal * @param \Zend\Soap\Client\Common $client * @param string $request * @param string $location * @param string $action * @param int $version * @param int $one_way * @return mixed */ public function _doRequest(Common $client, $request, $location, $action, $version, $one_way = null) { // Perform request as is ob_start(); $this->_server->handle($request); $response = ob_get_contents(); ob_end_clean(); return $response; }
public function testErrorHandlingOfSoapServerChangesToThrowingSoapFaultWhenInHandleMode() { if (headers_sent()) { $this->markTestSkipped('Cannot run ' . __METHOD__ . '() when headers have already been sent; enable output buffering to run this test'); return; } $server = new Server\Server(); $server->setOptions(array('location' => 'test://', 'uri' => 'http://framework.zend.com')); $server->setReturnResponse(true); // Requesting Method with enforced parameter without it. $request = '<?xml version="1.0" encoding="UTF-8"?>' . "\n" . '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" ' . 'xmlns:ns1="http://framework.zend.com" ' . 'xmlns:xsd="http://www.w3.org/2001/XMLSchema" ' . 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' . 'xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" ' . 'SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">' . '<SOAP-ENV:Body>' . '<ns1:testFunc5 />' . '</SOAP-ENV:Body>' . '</SOAP-ENV:Envelope>' . "\n"; $server->setClass('Zend_Soap_Server_TestClass'); $response = $server->handle($request); $this->assertContains('<SOAP-ENV:Fault><faultcode>Receiver</faultcode><faultstring>Test Message</faultstring></SOAP-ENV:Fault>', $response); }