ZF-4216: Infinite call loop in Zend_Soap_Client

Issue Type: Bug Created: 2008-09-06T19:39:04.000+0000 Last Updated: 2008-09-12T03:58:15.000+0000 Status: Resolved Fix version(s): - 1.6.1 (15/Sep/08)

Reporter: Bernd Schuler (bernd_schuler) Assignee: Alexander Veremyev (alexander) Tags: - Zend_Soap_Client

Related issues: - ZF-4152



Two days ago i downloaded Release 1.6.0 to test the Zend_Soap_Client. The code

$Options = array( 'soap_version' => SOAP_1_2, 'encoding' => 'ISO-8859-1' ); $Client = new Zend_Soap_Client('../server/soap_test.wsdl', $Options);

$Response = $Client->get_echo('test');

crashed (under XP / Apache 2.2 / PHP5.2.6)

The code

$Client = new SoapClient('../server/soap_test.wsdl', $Options);

$Response = $Client->__call('get_echo', array('test'));

did work.

I found that Zend_Soap_Client_Common::__doRequest(...) was called (on $this->_soapClient member of Zend_Soap_Client), this one called Zend_Soap_Client::_doRequest(...) which again called Zend_Soap_Client_Common::__doRequest(...) (I think, the base call SoapClient::__doRequest(...) was indented?) and so on.

I am not so familar with the architecture to locate the reason for this.

Best regards, Bernd Schuler

From code comments i guess something like this is intended:

  1. Add new function _doRequest to Zend_Soap_Client_Common class:

     function _doRequest($request, $location, $action, $version, $one_way)
         if ($one_way == null) {
             return parent::__doRequest($request, $location, $action, $version);
         } else {
             return parent::__doRequest($request, $location, $action, $version, $one_way);
  2. Change Zend_Soap_Client::_doRequest function to:

     public function _doRequest(Zend_Soap_Client_Common $client, $request, $location, $action, $version, $one_way = null)
         // Perform request as is
         return $client->_doRequest($request, $location, $action, $version, $one_way);

In this way extensions of Zend_Soap_Client can do some work ( in overwriting Zend_Soap_Client:: _doRequest(...) ), before the actual soap call is done. Eliminating Zend_Soap_Client_Common:: __doRequest(...) will undo this, because then SoapClient:: __doRequest(...) will be called immediately.

Best reagrds, Bernd Schuler

<pre class="highlight">
call_user_func(array($client, 'SoapClient::__doRequest'), $request, $location, $action, $version);

Cool, i didn't yet know this syntax in PHP to call base methods of extension classes.

Thanks, Bernd Schuler


Posted by Frank Ruske (fruske) on 2008-09-08T08:46:07.000+0000

Posted by Alexander Veremyev (alexander) on 2008-09-10T12:30:20.000+0000

Thanks for the report and detailed problem research!

A bit shoter way to fix: {panel} return $client->__doRequest($request, $location, $action, $version); {panel} ---> {panel} return call_user_func(array($client,'SoapClient::__doRequest'), $request, $location, $action, $version); {panel}

It directly calls necessary method.

Posted by Alexander Veremyev (alexander) on 2008-09-10T12:31:11.000+0000


Have you found an issue?

See the Overview section for more details.


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

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