|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-10-08 10:50 UTC] daniel dot seif at castex dot de
Description:
------------
When creating a soap client on a non-existing wsdl, an exception gets thrown and at the same time, a fatal error gets logged, but the script continues.
Test script:
---------------
try {
$client = new SoapClient('nonexistentfile.wsdl');
} catch (Exception $e) {
echo "catched exception: ", get_class($e), ": ", $e->getMessage();
}
echo "if we had a real Fatal error, we wouldn't execute this line\n";
Expected result:
----------------
catched exception: SoapFault: SOAP-ERROR: Parsing WSDL: Couldn't load from 'nonexistentfile.wsdl' : failed to load external entity "nonexistentfile.wsdl"
if we had a real Fatal error, we wouldn't execute this line
Actual result:
--------------
PHP Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'nonexistentfile.wsdl' : failed to load external entity "nonexistentfile.wsdl"
in /cab/src/dev/htdocs/test/scratchbook.php on line 102
catched exception: SoapFault: SOAP-ERROR: Parsing WSDL: Couldn't load from 'nonexistentfile.wsdl' : failed to load external entity "nonexistentfile.wsdl"
if we had a real Fatal error, we wouldn't execute this line
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 07:00:01 2025 UTC |
I just tested again: New Test script: <?php error_reporting(E_ALL | E_STRICT); ini_set('display_error', 'on'); header('Content-Type: text/plain'); try { $client = new SoapClient('nonexistentfile.wsdl'); } catch (Exception $e) { echo "caught exception: ", get_class($e), ": ", $e->getMessage(); } echo "if we had a real Fatal error, we wouldn't execute this line\n"; print_r(error_get_last()); ?> The result is the same as written in the bug report. There's also an entry with a fatal error in the web server's error log: [Sat Oct 16 23:39:54 2010] [error] [client ::1] PHP Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'nonexistentfile.wsdl' : failed to load external entity "nonexistentfile.wsdl"\n in /var/www/test2.php on line 8