Php Zend框架:捕获自定义soap异常

Php Zend框架:捕获自定义soap异常,php,web-services,zend-framework,soap,exception-handling,Php,Web Services,Zend Framework,Soap,Exception Handling,在请求soap web服务操作时,如何捕获自定义soap fault ProductionExistente?我的代码如下,但不起作用: $_WSDL_URI = 'http://joaquinlrobles.redirectme.net:8080/Pelopincho/PelopinchoService?WSDL'; $ws = new Zend_Soap_Client($_WSDL_URI, array('soap_version' => SOAP_1_1)); try { $res

在请求soap web服务操作时,如何捕获自定义soap fault ProductionExistente?我的代码如下,但不起作用:

$_WSDL_URI = 'http://joaquinlrobles.redirectme.net:8080/Pelopincho/PelopinchoService?WSDL';
$ws = new Zend_Soap_Client($_WSDL_URI, array('soap_version' => SOAP_1_1));
try {
 $resultado = $ws->getStockProducto(array('idProducto' => $idProducto));
 $this->view->resultado = $resultado->result;
}
catch (ProductoInexistente $ex) {
 $this->view->resultado = 'Producto Inexistente';
}

谢谢

是否抛出类型为
ProductoInexistente
的异常?
尝试将代码更改为

$_WSDL_URI = 'http://joaquinlrobles.redirectme.net:8080/Pelopincho/PelopinchoService?WSDL';
$ws = new Zend_Soap_Client($_WSDL_URI, array('soap_version' => SOAP_1_1));
try {
 $resultado = $ws->getStockProducto(array('idProducto' => $idProducto));
 $this->view->resultado = $resultado->result;
}
catch (Exception $ex) {
 var_dump($ex);
}
然后查看异常类的名称。

除非
ProductoInexistente
的异常不能被
catch(ProductoInexistente$ex)

捕获,通过转储,我可以看到捕获的异常是一个ProductoInexistente异常:object(SoapFault)#53(9){[“message:protected”]=>string(25)“comun.ProductoInexistente”…实际上不是。异常的对象似乎是SoapFault。因此如果您尝试{…}catch(SoapFault$ex){…}您应该捕获异常。是的,我应该捕获操作引发的所有自定义异常…在c#中,您应该捕获System.Services.SoapFault,一切正常…我在这里应该如何处理单独引发的每个自定义异常?