/** * calls the service with the given message * * @param MessageContract $message * @throws EndpointNotFoundException * @return mixed */ public function call(Message $message) { $this->message = $message; $endpoint = $this->message->getHeader()->getTarget()->getEndpoint(); if (!$this->hasEndpoint($endpoint)) { throw new EndpointNotFoundException(); } return $this->{$endpoint}(); }
/** * gets the endpoint by the * message's binding * * @param Message $message * @return string */ protected function getEndpointByBinding(Message $message) { return array_get($this->bindings, 'endpoints.' . $message->getHeader()->getSource()->getAction(), null); }