Bug #36629 [Com]: SoapServer::handle() exits on SOAP faults

From: Date: Fri, 19 Mar 2010 02:13:26 +0000
Subject: Bug #36629 [Com]: SoapServer::handle() exits on SOAP faults
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-148756@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=36629&edit=1

 ID:               36629
 Comment by:       druidmatrix at yahoo dot com
 Reported by:      ilya at iponweb dot net
 Summary:          SoapServer::handle() exits on SOAP faults
 Status:           Closed
 Type:             Bug
 Package:          SOAP related
 Operating System: Debian Linux (testing)
 PHP Version:      5CVS-2006-03-06 (snap)
 Assigned To:      dmitry

 New Comment:

I am still having this problem on Fedora Core 10.  PHP is:
[csit@fc10-test webservices]$ php -v
PHP 5.2.11 (cli) (built: Jan  4 2010 23:45:34)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

I am not able to catch the SoapFault on the server side at all - not
even by using a try-catch around $server->handle().  It looks like the
server is immediately generating the SoapFault and returning it to the
client; control never advances beyond the handle() call on the server
side.


Previous Comments:
------------------------------------------------------------------------
[2006-03-10 12:49:31] dmitry@php.net

Fixed in CVS HEAD and PHP_5_1.

------------------------------------------------------------------------
[2006-03-06 13:50:13] ilya at iponweb dot net

Description:
------------
When calling SoapServer::handle() it exits after processing the SOAP
request if request handler returns a SoapFault object. It makes
impossible to do any work on the SOAP server side after processing
requests if they result in SoapFault.

I belive exactly the same issue was reported in bug report #31993 but
for some reason it was closed without actually fixing the problem in the
soap extension. I could reproduce the problem with PHP 5.1.1 and with
PHP snapshot 5.1-200603061130.

The test code demostrates this problem. It is a simple soap server with
two remotly callable functions: test1 and test2. The first of them
simply returns a string, the second returns a soap fault object. The
server is supposed to write a string to a log file after processing a
request. If you call remotly test1 function then you can see the string
in the log, if you call remotly test2 function then the log file is
empty.

Reproduce code:
---------------
<?php

$server = new SoapServer(null, array('uri' => "http://test-uri/"));

$h = fopen("/tmp/soap.log", "w");

$server->addFunction(array('test1', 'test2'));
$server->handle();

fputs($h, 'TEST');
fclose($h);

function test1() {
	return "test1";
}

function test2() {
	return new SoapFault("test2", "test2");
}

?>

Expected result:
----------------
A log message in file /tmp/soap.log

Actual result:
--------------
Nothing when calling remotly 'test2' function.


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=36629&edit=1


Thread (9 messages)

« previous php.bugs (#148756) next »