PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Web Services » SOAP » Bug #7469

After a failed SOAP-call, further calls fail too

Details

Submitted2006-04-24 08:17 UTC
Fromprogrammieren at compusmile dot net
Assignedyunosh
StatusClosed
PackageSOAP
PHP Version5.1.2
OSDebian Sarge + backports PHP
Roadmaps(Not assigned)

Comments

[2006-04-24 08:17 UTC] programmieren at compusmile dot net

Description:
------------
For session handling it may be neccessary, that a script continues to send SOAP-Requests although a previous request may failed. I use a soap proxy to check a session identifier. If that fails, a new session is created.

If the first call fails, all further calls through SOAP fail too. This is because in Client::call, the return status of a request is determined by checking the presence of a _soap_transport->fault object. Since, in subsequent calls, the _soap_transport object is not re-created, the _soap_transport->fault object is not reset for new requests.

So, every request after a failed one will fail too, since Client::call checks the _soap_transport->fault object which may be present due to an earlier error.

As a workaround, I set the fault-Object of my transport-class (HTTP) to null on calls to HTTP::send.

Test script:
---------------
reproduce BUG:
$soapWSDL = new SOAP_WSDL('http://www.example.com/soap_server.php?wsdl');
$soapProxy =& $soapWSDL->getProxy();
$result = $soapProxy->checkSession($sessionID);
$result = $soapProxy->startSession('username','password');

workaround:
In the respective transport class (in Transport/*.php), add the following line to the send-method:
$this->fault = null;