|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42773 WSDL error causes HTTP 500 Response
Submitted: 2007-09-27 03:40 UTC Modified: 2007-11-01 14:12 UTC
Avg. Score:4.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:0 (0.0%)
From: tjerk dot meesters at muvee dot com Assigned: dmitry (profile)
Status: Closed Package: SOAP related
PHP Version: 5.2.4 OS: Linux 2.6
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
25 + 46 = ?
Subscribe to this entry?

 [2007-09-27 03:40 UTC] tjerk dot meesters at muvee dot com
Failure to load a WSDL file using the SoapClient class causes more than just an exception. The error is also caught by the error handler and a 500 status code is sent back.

This error is classified as a PHP Fatal error and can't be caught by any custom error handlers.

This error shouldn't be triggered at all, that's what we have exceptions for ;-)

Reproduce code:

try {
  $s = new SoapClient('http://localhost/invalid_wsdl');
} catch (Exception $e) {
  echo $e->getMessage();


Expected result:
SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://localhost/invalid_wsdl'

Actual result:
[HTTP/1.x 500 Internal Server Error]
PHP Fatal error:  SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://localhost/invalid_wsdl' in /var/www/html/test.php on line 4
SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://localhost/invalid_wsdl'


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-09-27 09:47 UTC]
Dmitry, this is propably related to the change with errors causing 500 error change you did.
 [2007-09-27 09:48 UTC]
See also bug #42722
 [2007-10-12 10:15 UTC] tjerk dot meesters at muvee dot com
The proposed solution in bug #42722 to make the status 500 depend on whether display errors is enabled doesn't help my problem.

In my case, no errors should be displayed at all because this would interfere with the otherwise clean output of json_encode().
 [2007-11-01 12:27 UTC]
Fixed in CVS HEAD and PHP_5_3 (not in PHP_5_2).
 [2007-11-01 14:12 UTC]
Committed into PHP_5_2 too.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jul 15 17:01:30 2024 UTC