Skip to content

Commit

Permalink
call cleanUpTemporaryState() if SoapFault is thrown in __soapCall fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lukastaferner committed Jul 29, 2019
1 parent 7abfc60 commit 9abaffe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Phpro/SoapClient/Soap/Driver/ExtSoap/ExtSoapDecoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ public function __construct(AbusedClient $client, DummyMethodArgumentsGenerator
public function decode(string $method, SoapResponse $response)
{
$this->client->registerResponse($response);
$decoded = $this->client->__soapCall($method, $this->argumentsGenerator->generateForSoapCall($method));
try {
$decoded = $this->client->__soapCall($method, $this->argumentsGenerator->generateForSoapCall($method));
} catch (\Exception $e) {
$this->client->cleanUpTemporaryState();
throw $e;
}
$this->client->cleanUpTemporaryState();

return $decoded;
Expand Down

0 comments on commit 9abaffe

Please sign in to comment.