|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-02-14 11:15 UTC] david at jool dot nl
Description:
------------
When using the soap extension to expose a certain class and setting the persistence to SOAP_PERSISTENCE_SESSION, PHP crashes when I throw an Exception.
Reproduce code:
---------------
<?php
class test1 {
function soapFunction($param) {
throw new Exception("something went wrong");
return "blaat aap: ". $param;
}
}
if($_GET["type"]=="server") {
$server = new SOAPServer(null, array("uri"=> "http://some.example.uri/"));
$server->setClass("test1");
$server->setPersistence(SOAP_PERSISTENCE_SESSION);
$server->handle();
} else { //client
$client = new SOAPClient(null, array('location' => 'http://'.$_SERVER["HTTP_HOST"].$_SERVER["SCRIPT_NAME"].'?type=server', 'uri'=> 'http://some.example.uri/'));
$res = $client->__call("soapFunction", array("hey!"));
var_dump($res);
}
?>
Expected result:
----------------
Fatal error: Uncaught SoapFault exception: [Client] looks like we got no XML document in f:\myweb\contentarea\tests\bug_exception.php:15 Stack trace: #0 f:\myweb\contentarea\tests\bug_exception.php(15): SoapClient->__call('soapFunction', Array) #1 {main} thrown in f:\myweb\contentarea\tests\bug_exception.php on line 15
Actual result:
--------------
PHP / Apache crash
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 08:00:01 2025 UTC |
Possible patch --- F:\dev\php 5.1.2\php-src\ext\soap\soap.c Sun Jan 01 13:50:14 2006 +++ f:\dev\php-modified\ext\soap\soap.c Wed Mar 01 15:04:19 2006 @@ -1712,7 +1712,7 @@ instanceof_function(Z_OBJCE_P(EG(exception)), soap_fault_class_entry TSRMLS_CC)) { soap_server_fault_ex(function, EG(exception), NULL TSRMLS_CC); } else { - if (soap_obj) {zval_ptr_dtor(&soap_obj);} + if (soap_obj && service->soap_class.persistance != SOAP_PERSISTENCE_SESSION) {zval_ptr_dtor(&soap_obj);} php_end_ob_buffer(0, 0 TSRMLS_CC); goto fail; }