我试图在zf2中获取onBootstrap函数的响应。它详细地给了我getRequest对象,即已经发出的Soap请求。但它并没有给我带来竞争的getResponse对象,即Soap响应。它作为响应返回的唯一内容是 HTTP / 1.1 200 OK 。引导代码如下:
public function onBootstrap(MvcEvent $e)
{
$app = $e->getApplication();
$em = $app->getEventManager();
$response = new Response();
$logger = $sm->get('Zend\Log\Logger');
$params = $e->getParams();
$logger->debug(sprintf(
'Route event with route %s with name %s, response: %s ',
json_encode($params),
$e->getApplication()->getRequest(),
$e->getApplication()->getResponse()
));
}
答案 0 :(得分:0)
能够通过在Soap Server中添加行setResponse(true)来解决问题。