src/Web/Communicator.php
public function callApiFunction($apiFunction, array $message, Result $result = null)
    {
        if ($result === null) {
            $result = $this->container->getResult();
        }
        $uri = $this->getUri($apiFunction);

        try {
            $commonMessagePart = $this->getCommonPart();
            $message = array_merge($commonMessagePart, $message);

            // Send message, receive response.
            $result = $this->sendApiMessage($uri, $message, $result);
        } catch (RuntimeException $e) {
            $result->setException($e);
        }

        $this->log->debug('Communicator::callApiFunction() uri=%s; %s', $uri, $result->toLogString());
        return $result;
    }
public function callApiFunction($apiFunction, array $message, Result $result = null)
    {
        if ($result === null) {
            $result = $this->container->getResult();
        }
        $uri = $this->getUri($apiFunction);

        try {
            $commonMessagePart = $this->getCommonPart();
            $message = array_merge($commonMessagePart, $message);

            // Send message, receive response.
            $result = $this->sendApiMessage($uri, $message, $result);
        } catch (RuntimeException $e) {
            $result->setException($e);
        }

        $this->log->debug('Communicator::callApiFunction() uri=%s; %s', $uri, $result->toLogString());
        return $result;
    }
public function callApiFunction ( $ apiFunction , array $ message , Result $ result = null ) { if ( $ result === null ) { $ result = $ this -> container -> getResult ( ) ; } $ uri = $ this -> getUri ( $ apiFunction ) ; try { $ commonMessagePart = $ this -> getCommonPart ( ) ; $ message = array_merge ( $ commonMessagePart , $ message ) ; // Send message, receive response. $ result = $ this -> sendApiMessage ( $ uri , $ message , $ result ) ; } catch ( RuntimeException $ e ) { $ result -> setException ( $ e ) ; } $ this -> log -> debug ( 'Communicator::callApiFunction() uri=%s; %s' , $ uri , $ result -> toLogString ( ) ) ; return $ result ; }
Sends a message to the given API function and returns the results.

@param string $apiFunction
The API function to invoke.
@param array $message
The values to submit.
@param \Siel\Acumulus\Web\Result $result
It is possible to already create a Result object before calling the Web
Service to store local messages. By passing this Result object these
local messages will be merged with any remote messages in the returned
Result object.

@return \Siel\Acumulus\Web\Result
A Result object containing the results.
Sends a message to the given API function and returns the results .