Hi all,

Is there a way to access the exception values from rules?

Comments

Patrick Danielsson’s picture

I wonder if this is possible too, I think Rules is a good way to use Web service client for my case, but I can't access $e->getMessage(); in any way.

In the code for wsclient_soap.module, the following code is what creates the error message for Watchdog.

<?php
  /**
   * Calls the SOAP service.
   *
   * @param string $operation
   *   The name of the operation to execute.
   * @param array $arguments
   *   Arguments to pass to the service with this operation.
   */
  public function call($operation, $arguments) {
    $client = $this->client();
    try {
      $response = $client->__soapCall($operation, $arguments);
      return $response;
    }
    catch (SoapFault $e) {
      throw new WSClientException('Error invoking the SOAP service %name, operation %operation: %error', array('%name' => $this->service->label, '%operation' => $operation, '%error' => $e->getMessage()));
    }
  }
}
?>