ID: 34657 Updated by: [EMAIL PROTECTED] Reported By: gareth at wsys dot co dot uk Status: Open Bug Type: SOAP related Operating System: Windows, Linux PHP Version: 5.1.6 Assigned To: dmitry New Comment:
In general nothing in ext/soap should be fatal if its not within the control of the local php application. This means missing WSDL, changes to the WSDL etc. All of this needs to be catchable in some way or another (exception, returning false .. etc). Also if an exception is thrown no warnings should be thrown for the same issue. Previous Comments: ------------------------------------------------------------------------ [2007-01-15 15:53:18] jhendric at sierra-bravo dot com Similar problem here with PHP 5.1.6. try { $soap = new SoapClient('[...]', array('exceptions' => true)); // Note: Same results without or without exceptions => true } catch(Exception $e) { var_dump($e); } Results in: Warning: SoapClient::__construct([...]) [function.SoapClient---construct]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in [...] Warning: SoapClient::__construct() [function.SoapClient---construct]: I/O warning : failed to load external entity "..." in [...] Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from '[...]' in [...] ------------------------------------------------------------------------ [2006-12-21 23:32:24] [EMAIL PROTECTED] I get 3 warning + a SoapFault exception when running Lukas' test case there. The output is: Warning: SoapClient::SoapClient(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/ek/projects/php_5_2/t on line 4 Warning: SoapClient::SoapClient(http://i_dont_exist.com/some.wsdl): failed to open stream: No such file or directory in /home/ek/projects/php_5_2/t on line 4 Warning: SoapClient::SoapClient(): I/O warning : failed to load external entity "http://i_dont_exist.com/some.wsdl" in /home/ek/projects/php_5_2/t on line 4 string(9) "SoapFault" NULL I think getting 3 warning and an exception for failing to load WSDL file is a bit excessive though :) ------------------------------------------------------------------------ [2006-12-19 14:10:44] [EMAIL PROTECTED] I can reproduce this error with php 5.1.4 and 5.2.0 on windows. And it seems Derick was also able to reproduce it on Linux. Using the following we get 3 warnings and a fatal error: <?php try { $client = new SoapClient('http://i_dont_exist.com/some.wsdl'); } catch (SoapFault $e) { var_dump(get_class($e)); } catch (Exception $e) { var_dump(get_class($e)); } var_dump($client); It really should not do anything but throw an exception, as this is what is defined to happen for fatal errors in constructors for all extensions. ------------------------------------------------------------------------ [2006-09-12 09:56:52] gareth at wsys dot co dot uk OK, the debug information shows that the Soap client class is now throwing an uncaught SoapFault exception (which causes the fatal error). with a try{ } catch(SoapFault $exception) I can continue the script. I've closed the bug. ------------------------------------------------------------------------ [2006-09-12 08:56:12] [EMAIL PROTECTED] I cannot reproduce the bug even with 5.1.4. Try "php -d log_errors=0 test.php". May be you are seeing log message and don't see "Error Caught" after it? ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/34657 -- Edit this bug report at http://bugs.php.net/?id=34657&edit=1