ZF-12393: SoapFault returning is not in XML format

Issue Type: Bug Created: 2012-08-30T03:13:59.000+0000 Last Updated: 2012-12-22T20:54:36.000+0000 Status: Resolved Fix version(s): - 1.12.2 (25/Feb/13)

Reporter: Chris Kings-Lynne (chriskl) Assignee: Rob Allen (rob) Tags: - Zend_Soap_Server

  • FixForZF1.12.1

Related issues: Attachments:


I'm not sure when this broke, but after a recent upgrade to ZF 1.12.0 I tried my Zend_Soap_Server service again using SoapUI, and found that when an exception is thrown I'm getting a response like this:

<pre class="highlight"> 
HTTP/1.1 200 OK
Date: Thu, 30 Aug 2012 02:48:31 GMT
Server: Apache/2.2.16 (Win32) mod_ssl/2.2.16 OpenSSL/0.9.8o
X-Powered-By: PHP/5.3.8-ZS5.5.0 ZendServer
Set-Cookie: ZDEDebuggerPresent=php,phtml,php3; path=/
Set-Cookie: PHPSESSID=ujk8qs9d6f4lb8e1k2028dv3s4; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8

SoapFault exception: [Receiver] Your account is currently locked out for 15 minutes. in C:\Program Files\Zend\ZendServer\share\ZendFramework\library\Zend\Soap\Server.php:1001
Stack trace:
#0 C:\Program Files\Zend\ZendServer\share\ZendFramework\library\Zend\Soap\Server.php(888): Zend_Soap_Server->fault(Object(Api_Exception))
#1 C:\Development\accord\application\modules\api\controllers\SoapController.php(41): Zend_Soap_Server->handle()
#2 C:\Program Files\Zend\ZendServer\share\ZendFramework\library\Zend\Controller\Action.php(516): Api_SoapController->serviceAction()
#3 C:\Program Files\Zend\ZendServer\share\ZendFramework\library\Zend\Controller\Dispatcher\Standard.php(308): Zend_Controller_Action->dispatch('serviceAction')
#4 C:\Program Files\Zend\ZendServer\share\ZendFramework\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#5 C:\Program Files\Zend\ZendServer\share\ZendFramework\library\Zend\Application\Bootstrap\Bootstrap.php(97): Zend_Controller_Front->dispatch()
#6 C:\Program Files\Zend\ZendServer\share\ZendFramework\library\Zend\Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#7 C:\Development\accord\public\index.php(30): Zend_Application->run()
#8 {main}

This is happening because in line 903 of Zend_Soap_Server.php, it has this:

<pre class="highlight"> 
        if (!$this->_returnResponse) {
            echo $this->_response;

Just echoing the response (which in this case is a SoapFault) does NOT give an XML rendering compatible with the SOAP protocol. It looks like you'd need to go $soap->fault(faultCode, faultMessage) instead...


Posted by Chris Kings-Lynne (chriskl) on 2012-08-30T03:17:09.000+0000

PHP 5.3.8

Posted by Chris Kings-Lynne (chriskl) on 2012-09-03T05:45:03.000+0000

Guys, this was broken in this exact commit, for 1.11:…&

Surely this is critical!?!?

The code is assuming that going 'echo SoapFault object' is the same as going 'SoapServer->fault()' - which it is not!

Posted by Alexander Weps (exander) on 2012-11-07T18:51:35.000+0000

Patch for this issue?

Posted by Van Belle Jonathan (grummfy) on 2012-11-08T14:30:52.000+0000

Hello, to make a quick fix i do this : in Zend_Soap_Server, around line 899 I change this :

<pre class="highlight">
        if ($fault) {
            $this->_response = $fault;

to this

<pre class="highlight">
        if ($fault) {
            $soap->fault($fault->faultcode, $fault->faultstring);

Posted by Rob Allen (rob) on 2012-12-22T20:54:36.000+0000

Fixed on trunk (25176) and release-1.12 (25177)

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.