public function call($method, $request = null, $parameters = null, $headers = null, $options = [])
    {
        // build up ServiceRequest
        if (is_a($request, ServiceRequestInterface::class)) {
            /** @var ServiceRequestInterface $request */
            $this->request = $request->setMethod($method);

        } else {
            // $request is the request body

            $class = $this->requestDefaultsClass;

            $this->request = new $class($request, $parameters, $headers, $method, null, $options);

            $this->checkRequestClassType($this->request);
        }

        $this->checkRequest();

        $this->supplementRequestWithDefaults();

        $this->resetResponseInformation();


        if ( ! $this->firstCallIsMade) {
            $this->firstCallIsMade = true;
            $this->beforeFirstCall();
        }

        $this->before();

        $this->rawResponse = $this->callRaw($this->request);

        $this->afterRaw();

        $this->interpretResponse();

        $this->after();

        return $this->getLastInterpretedResponse();
    }
public function call($method, $request = null, $parameters = null, $headers = null, $options = [])
    {
        // build up ServiceRequest
        if (is_a($request, ServiceRequestInterface::class)) {
            /** @var ServiceRequestInterface $request */
            $this->request = $request->setMethod($method);

        } else {
            // $request is the request body

            $class = $this->requestDefaultsClass;

            $this->request = new $class($request, $parameters, $headers, $method, null, $options);

            $this->checkRequestClassType($this->request);
        }

        $this->checkRequest();

        $this->supplementRequestWithDefaults();

        $this->resetResponseInformation();


        if ( ! $this->firstCallIsMade) {
            $this->firstCallIsMade = true;
            $this->beforeFirstCall();
        }

        $this->before();

        $this->rawResponse = $this->callRaw($this->request);

        $this->afterRaw();

        $this->interpretResponse();

        $this->after();

        return $this->getLastInterpretedResponse();
    }
public function call ( $ method , $ request = null , $ parameters = null , $ headers = null , $ options = [ ] ) { // build up ServiceRequest if ( is_a ( $ request , ServiceRequestInterface :: class ) ) { /** @var ServiceRequestInterface $request */ $ this -> request = $ request -> setMethod ( $ method ) ; } else { // $request is the request body $ class = $ this -> requestDefaultsClass ; $ this -> request = new $ class ( $ request , $ parameters , $ headers , $ method , null , $ options ) ; $ this -> checkRequestClassType ( $ this -> request ) ; } $ this -> checkRequest ( ) ; $ this -> supplementRequestWithDefaults ( ) ; $ this -> resetResponseInformation ( ) ; if ( ! $ this -> firstCallIsMade ) { $ this -> firstCallIsMade = true ; $ this -> beforeFirstCall ( ) ; } $ this -> before ( ) ; $ this -> rawResponse = $ this -> callRaw ( $ this -> request ) ; $ this -> afterRaw ( ) ; $ this -> interpretResponse ( ) ; $ this -> after ( ) ; return $ this -> getLastInterpretedResponse ( ) ; }
Performs a call on the service, returning an interpreted response

@param string $method     name of the method to call through the service
@param mixed  $request    either: request object, or the request body
@param mixed  $parameters extra parameters to send along (optional)
@param mixed  $headers    extra headers to send along (optional)
@param array  $options    extra options to set on f.i. the soap client used
@return ServiceResponse fallback to mixed if no interpreter available; make sure there is one
Performs a call on the service returning an interpreted response