|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51273 Faultstring property does not exist when the faultstring is empty
Submitted: 2010-03-11 13:55 UTC Modified: 2010-06-09 17:48 UTC
Avg. Score:4.6 ± 0.8
Reproduced:5 of 5 (100.0%)
Same Version:4 (80.0%)
Same OS:4 (80.0%)
From: dennis at transip dot nl Assigned: iliaa (profile)
Status: Closed Package: SOAP related
PHP Version: 5.2.13 OS: FreeBSD 7.0-STABLE
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:
42 + 25 = ?
Subscribe to this entry?

 [2010-03-11 13:55 UTC] dennis at transip dot nl
When a SoapServer sends back a SoapFault response with an empty faultstring, PHP will not set the $faultstring property of the thrown SoapFault object.

The following SOAP response will result in the $faultstring property not being set:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV=""><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>test</faultcode><faultstring></faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>

Test script:
$server = new SoapServer(null, array('uri' => "http://test-uri/"));
function test($inputString) {
    global $server;
    $server->fault('test', '');

$client = new SoapClient(null, array('location' => "http://localhost/server.php",'uri'=> "http://test-uri/"));
 echo $client->test('hello?');
catch(SoapFault $f) {
   echo isset($f->faultstring) ? "has faultstring\n" : "no faultstring\n";

Expected result:
has faultstring

Actual result:
no faultstring


soap-faultstring-not-set-patch.diff (last revision 2010-03-11 12:55 UTC by dennis at transip dot nl)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-05-03 19:48 UTC]
Automatic comment from SVN on behalf of pajoye
Log: - #51273, Content-length header is limited to 32bit integer with apache2/windows
 [2010-05-03 21:53 UTC]
Automatic comment from SVN on behalf of pajoye
Log: - revert #51273
 [2010-06-09 17:48 UTC]
Automatic comment from SVN on behalf of iliaa
Log: Fixed bug #51273 (Faultstring property does not exist when the faultstring is empty)

# Patch by dennis at transip dot nl
 [2010-06-09 17:48 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: iliaa
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Mon Oct 03 21:03:57 2022 UTC