|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48777 Option to control SoapFault HTTP Status return (Reopen of #43507)
Submitted: 2009-07-02 13:53 UTC Modified: -
Avg. Score:4.0 ± 0.9
Reproduced:6 of 8 (75.0%)
Same Version:1 (16.7%)
Same OS:5 (83.3%)
From: jeff_dafoe at harte-hanks dot com Assigned:
Status: Open Package: SOAP related
PHP Version: 5.2.10 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: jeff_dafoe at harte-hanks dot com
New email:
PHP Version: OS:


 [2009-07-02 13:53 UTC] jeff_dafoe at harte-hanks dot com
Bug #43507 describes an issue with Adobe Flex / Flash / Air where the host browser does not pass the HTTP response body down to the Flash player when the browser receives a HTTP status code of 500.  The bug suggests that the ability to set the HTTP status code be allowed.  The fix that was decided on instead was to look for the user agent string "Shockwave Flash".

The issue with this solution is that the player's requests either never did, only do on some platforms, or no longer contain this user agent string.  The player's requests contain the user agent string associated with the host browser.  AIR requests (a platform where the host browser is integrated into the Flash plugin, essentially) contain the Webkit UA string.  

To work around this we have patched soap.c's soap_server_fault_ex to set use_http_error_status to 0.  Ideally, this setting could be exposed in the SoapServer constructor's "options" or "features".  Since this is a workaround for a limitation in web browser's NAPI and not a problem with the SOAP library itself, making the use_http_error_status available as an option seems like an acceptable compromise.

Reproduce code:
throw new SoapFault('Client', $_SERVER['HTTP_USER_AGENT']);

Expected result:
HTTP/1.1 200 OK

Actual result:
HTTP/1.1 500 Internal Service Error


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-14 23:10 UTC] ld at e dot pl
This patch you made doesn't make sense for most applications. 
Simply you put:

if (use_http_error_status) {
		sapi_add_header("HTTP/1.1 500 Internal Service Error", 
sizeof("HTTP/1.1 500 Internal Service Error")-1, 1);

but use_http_error_status is false only if HTTP_USER_AGENT=='Shockwave 
Flash' what it's only true if you are using AIR standalone but if you 
have embeded Flex code into a webpage then you HTTP_USER_AGENT is a 
browser one not the Shackwave Flash. 

Could you go here for something simpler like setting for SoapServer 
class telling the system if you want this HTTP 500 or not?
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jul 15 11:01:29 2024 UTC