[英]Zend Framework: catch custom soap exceptions
how do I catch my custom soap fault ProductoInexistente when requesting a soap web service operation? 请求肥皂Web服务操作时如何捕获我的自定义肥皂故障ProductoInexistentente? my code is the following, but it's not working:
我的代码如下,但是不起作用:
$_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';
}
thanks! 谢谢!
Is there the exception of type ProductoInexistente
thrown? 是否抛出了异常
ProductoInexistente
?
Try changing the code to 尝试将代码更改为
$_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);
}
And see what's the name of exception class. 并查看异常类的名称是什么。
Unless the exception of ProductoInexistente
it cannot be caught by catch(ProductoInexistente $ex)
除非
ProductoInexistente
例外,否则不能被catch(ProductoInexistente $ex)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.