Example #1
0
 /**
  * {@inheritdoc}
  */
 public function call($action, $params = [])
 {
     if (!$this->client) {
         throw new InvalidConfigurationException("SOAP Transport does not configured properly.");
     }
     try {
         $result = $this->client->__soapCall($action, $params);
     } catch (\Exception $e) {
         $isUnknownMethod = strpos($e->getMessage(), 'is not a valid method') !== false || $e->getMessage() === sprintf("Procedure '%s' not present", $action);
         if (!$isUnknownMethod && $this->isAttemptNecessary()) {
             $result = $this->makeNewAttempt($action, $params);
         } else {
             $this->resetAttemptCount();
             throw SoapConnectionException::createFromResponse($this->getLastResponse(), $e, $this->getLastRequest(), $this->getLastResponseHeaders());
         }
     }
     $this->resetAttemptCount();
     return $result;
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function call($action, $params = [])
 {
     if (!$this->client) {
         throw new InvalidConfigurationException("SOAP Transport does not configured properly.");
     }
     try {
         $result = $this->client->__soapCall($action, $params);
     } catch (\Exception $e) {
         if ($this->isAttemptNecessary()) {
             $this->logAttempt();
             sleep($this->getSleepBetweenAttempt());
             $this->attempt();
             $result = $this->call($action, $params);
         } else {
             $this->resetAttemptCount();
             throw SoapConnectionException::createFromResponse($this->getLastResponse(), $e, $this->getLastRequest(), $this->getLastResponseHeaders());
         }
     }
     $this->resetAttemptCount();
     return $result;
 }