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

Reply via email to