protected function deserialize(ResponseInterface $response, $type, $format = 'json')
    {
        try {
            return $this->serializer->deserialize(
                (string) $response->getBody(),
                $type,
                $format
            );
        } catch (\Exception $exception) {
            $this->logger->error(
                '[WebServiceClient] Deserialization problem on webservice call.',
                array(
                    'response' => (string) $response->getBody(),
                    'exception' => $exception,
                )
            );

            throw $exception;
        }
    }