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

From: Date: Mon, 11 Feb 2019 09:44:35 +0000
Subject: Bug #77601 [Opn->Fbk]: 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-219495@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: Open +Status: Feedback Type: Bug Package: SOAP related Operating System: Windows 7 PHP Version: 7.3.2 Block user comment: N Private report: N New Comment: 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)? Previous Comments: ------------------------------------------------------------------------ [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 (#219495) next »