You are here

public function ServicesClientConnectionRestServer::processResponse in Services Client 7

Same name and namespace in other branches
  1. 7.2 services_client_connection/plugins/ServicesClientConnectionRestServer.inc \ServicesClientConnectionRestServer::processResponse()

Implements processResponse().

Overrides ServicesClientConnectionPlugin::processResponse

File

services_client_connection/plugins/ServicesClientConnectionRestServer.inc, line 134

Class

ServicesClientConnectionRestServer
@file

Code

public function processResponse(ServicesClientConnectionResponse &$response) {
  parent::processResponse($response);

  // Try to get error code from response
  if (ServicesClientConnectionHttp::isError($response->response_code)) {
    $response->error_code = $response->response_code;
    $response->error_message = ServicesClientConnectionHttp::getHttpMessage($response->response_code);
    if (!empty($response->raw_response)) {
      $response->data = $this->parser
        ->parse($response->raw_response);
    }
  }
  else {

    // Process response and parse data
    $response->data = $this->parser
      ->parse($response->raw_response);
  }
}