Example #1
0
 /**
  * {@inheritDoc}
  */
 public function __soapCall($function_name, $arguments, $options = array(), $input_headers = null, &$output_headers = null)
 {
     try {
         $result = parent::__soapCall($function_name, $arguments, $options, $input_headers, $output_headers);
         // Some requests may return the status as a simple string result ...
         if (is_string($result)) {
             $result = array('Status' => $result);
         }
         // ... and some return an array.
         if ('OK' !== $result['Status']) {
             throw ApiException::createIncorrectStatus($result['Status']);
         }
     } catch (\SoapFault $e) {
         throw ApiException::createFromSoapFault($e);
     }
     return $result;
 }
Example #2
0
 /**
  * @param Envelope $envelope
  *
  * @throws ApiException If the DigiDoc envelope is not merged
  */
 private function failIfNotMerged(Envelope $envelope)
 {
     if (!$this->tracker->has($envelope)) {
         throw ApiException::createNotMerged($envelope);
     }
 }