Bug #63474 [Com]: Fatal errors may be thrown when turning off exceptions
| From: | dmeziere at free dot fr | Date: | Fri, 30 Nov 2012 09:14:35 +0000 |
| Subject: | Bug #63474 [Com]: Fatal errors may be thrown when turning off exceptions | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-175043@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=63474&edit=1
ID: 63474
Comment by: dmeziere at free dot fr
Reported by: dean at deansas dot org
Summary: Fatal errors may be thrown when turning off
exceptions
Status: Open
Type: Bug
Package: SOAP related
PHP Version: 5.3.18
Block user comment: N
Private report: N
New Comment:
$foo won't be a SoapFault object. SoapFault is an excepion. And an exception is thrown, not
instanciated.
Previous Comments:
------------------------------------------------------------------------
[2012-11-09 19:06:09] dean at deansas dot org
Description:
------------
When disabling exceptions in the constructor to SoapClient, I did not expect that
for some errors it would trigger warnings and fatal errors. I did expect that it
would return SoapFault objects instead, as documented on
http://uk3.php.net/manual/en/function.is-soap-fault.php.
In the event that this is expected behaviour then the documentation should make
this clear.
Test script:
---------------
// URL requiring http auth and passing incorrect username & password
$foo = new SoapClient("http://example.com/foo.wsdl",
array( 'login' => 'bar', 'password' => 'baz',
'exceptions' => false));
print $foo;
Expected result:
----------------
That $foo is a SoapFault object, no warnings/errors are thrown and something like
the below is output:
[WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://example.com/foo.wsdl'
: failed to load external entity "http://example.com/foo.wsdl"
in test.php:4
Stack trace:
#0 test.php(4): SoapClient->SoapClient('http://example....', Array)
#1 {main}
Actual result:
--------------
Warning: SoapClient::SoapClient(http://example.com/foo.wsdl): failed to open
stream: HTTP request failed! HTTP/1.1 401 Authorization Required
in test.php on line 4
Warning: SoapClient::SoapClient(): I/O warning : failed to load external entity
"http://example.com/foo.wsdl" in test.php
on line 4
Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from
'http://example.com/foo.wsdl' : failed to
load external entity
"http://example.com/foo.wsdl"
in test.php on line 4
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=63474&edit=1