php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #49513 SoapServer->fault() shouldn't halt execution
Submitted: 2009-09-09 12:54 UTC Modified: 2010-12-29 12:18 UTC
Votes:87
Avg. Score:4.6 ± 0.7
Reproduced:80 of 81 (98.8%)
Same Version:27 (33.8%)
Same OS:58 (72.5%)
From: amr dot mostafa at gmail dot com Assigned:
Status: Open Package: SOAP related
PHP Version: 5.3.0 OS: GNU/Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: amr dot mostafa at gmail dot com
New email:
PHP Version: OS:

 

 [2009-09-09 12:54 UTC] amr dot mostafa at gmail dot com
Description:
------------
Calling SoapServer->fault() causes execution to terminate, there is no way for the developer to get the XML response itself and process it differently.


Reproduce code:
---------------
$server = SoapServer(NULL, array('location' => 'http://example.com', 'uri' => 'http://example.com'));
$server->fault('foo', 'bar');
echo 'We are past $sever->fault()!'


Expected result:
----------------
We are past $server->fault()!


Actual result:
--------------
"We are past $server->fault()!" is never printed, only the XML for the SOAP Fault is.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-29 12:18 UTC] jani@php.net
-Package: Feature/Change Request +Package: SOAP related
 [2012-08-09 12:45 UTC] jeroen at asystance dot nl
This behavior is very undesirable!

How can I let a client know about the fault _and_ do server-side Exception handling?

I'd love to do

try {
  $server->handle();
} catch (Exception $e) {
  $server->fault($e->getCode(), $e->getMessage());
  throw $e;
}

To have default handling for uncaught Exceptions (which logs to file, email, whatever), but that's not possible.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 09:01:28 2024 UTC