Bug #77601 [Fbk->Opn]: WSDL parsing issue throws a fatal error instead of a SOAPFault exception

From: Date: Mon, 11 Feb 2019 10:26:40 +0000
Subject: Bug #77601 [Fbk->Opn]: WSDL parsing issue throws a fatal error instead of a SOAPFault exception
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-219498@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77601&edit=1 ID: 77601 Updated by: nikic@php.net Reported by: nikstar at ukr dot net Summary: WSDL parsing issue throws a fatal error instead of a SOAPFault exception -Status: Feedback +Status: Open Type: Bug Package: SOAP related Operating System: Windows 7 PHP Version: 7.3.2 -Assigned To: +Assigned To: derick Block user comment: N Private report: N New Comment: @derick: Is there anything that can be done about this on the xdebug side? ext/soap has some horrible error handling where it throws fatal errors all over the place and uses a custom error handler to convert them to exceptions and bail out (soap_error_handler). I think the interaction with xdebug might be because xdebug ends up wrapping the soap handler, rather than soap the xdebug handler. Previous Comments: ------------------------------------------------------------------------ [2019-02-11 10:06:56] nikstar at ukr dot net This bug is reproducing in PHP 7.3.2 with enabled Xdebug extension. With disabled Xdebug - bug not reproduce. ------------------------------------------------------------------------ [2019-02-11 09:44:35] nikic@php.net I can't reproduce this. I know this used to be an issue, but was fixed in bug #70469. Are you sure that this is on PHP 7.3.2 and not some older version also installed on your system? Can you check if it works with php -n (-n meaning no ini file)? ------------------------------------------------------------------------ [2019-02-11 09:26:53] nikstar at ukr dot net Description: ------------ Subclassing the SoapClient class and wrapping the call to the parent constructor will throw a fatal error even when wrapped in a try...catch(\Throwable $t). With PHP 7.3.2 try...catch(\Throwable $t) being a convenient method of adding fault tolerance and graceful degradation -- it is therefore very frustrating when a WSDL PARSE issue is encountered that an UNCATCHABLE script exiting fatal error is issued. Test script: --------------- <?php class SoapAgent extends \SoapClient { public function __construct(string $wsdl) { try { parent::__construct($wsdl); echo 'Success!' . PHP_EOL; } catch (\Throwable $t) { var_dump($t); } } } $client = new SoapAgent('test'); Expected result: ---------------- var_dump() of the Throwable object. Actual result: -------------- Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'test' : failed to load external entity "test" Process finished with exit code 255 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=77601&edit=1

« previous php.bugs (#219498) next »