/**
  * Dispatch a request and return the response
  *
  * @param  Request\RequestInterface $request The request to dispatch
  *
  * @return Response\ResponseInterface        The response to the request
  *
  * @throws \SoapFault if a soap fault occurs
  * @throws Exception\ResponseErrorException If an error-level notification
  *                                          is returned
  */
 public function dispatch(Request\RequestInterface $request)
 {
     // TODO: log !
     // TODO: catch soapfaults?
     // Validate the request
     $request->validate();
     // Prepare the request
     $preparedRequest = clone $this->_preparedRequest;
     $preparedRequest->setRequest($request);
     // Dispatch the "API Request" event
     $this->_eventDispatcher->dispatch(Events::REQUEST, new Event\RequestEvent($this, $preparedRequest));
     // Create the SOAP client
     $client = $this->getSoapClient($request->getService());
     // Send the request
     try {
         $responseData = $client->{$request->getMethod()}($preparedRequest->getData());
     } catch (\SoapFault $e) {
         throw $e;
         // TODO: Do stuff with this
     }
     // Build response object
     $response = $request->getResponseObject();
     $response->setData($responseData);
     $response->setPreparedRequest($preparedRequest);
     $response->setNotifications(Notification\Collection::loadFromResponse($response));
     // Throw response failure exception if the response has errors
     if ($response->getNotifications()->hasErrors()) {
         throw Exception\ResponseErrorException::createFromResponse($response);
     }
     $response->validate();
     $response->init();
     // Dispatch the "API Response" event
     $this->_eventDispatcher->dispatch(Events::RESPONSE, new Event\ResponseEvent($this, $response));
     return $response;
 }