From 6a5109c526165e41d8e6a4c2a17788bcb4fe0020 Mon Sep 17 00:00:00 2001 From: Andreas Schamberger Date: Mon, 19 Aug 2013 19:26:11 +0200 Subject: [PATCH] fix SoapFault handling to throw proper soap fault to client --- src/BeSimple/SoapServer/SoapServer.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/BeSimple/SoapServer/SoapServer.php b/src/BeSimple/SoapServer/SoapServer.php index ced2ad0..d8d24a8 100644 --- a/src/BeSimple/SoapServer/SoapServer.php +++ b/src/BeSimple/SoapServer/SoapServer.php @@ -70,7 +70,12 @@ class SoapServer extends \SoapServer $soapRequest = SoapRequest::create($request, $this->soapVersion); // handle actual SOAP request - $soapResponse = $this->handle2($soapRequest); + try { + $soapResponse = $this->handle2($soapRequest); + } catch (\SoapFault $fault) { + // issue an error to the client + $this->fault($fault->faultcode, $fault->faultstring); + } // send SOAP response to client $soapResponse->send();