protected function handleSubResponse(Response $subResponse, $oidStr=null) {
    $response = $this->getResponse();
    if (!$subResponse->hasErrors()) {
      $response->clearValues();
      $response->setHeaders($subResponse->getHeaders());
      $response->setStatus($subResponse->getStatus());
      if ($subResponse->hasValue('object')) {
        $object = $subResponse->getValue('object');
        if ($object != null) {
          $response->setValue($object->getOID()->__toString(), $object);
        }
      }
      if ($subResponse->hasValue('list')) {
        $objects = $subResponse->getValue('list');
        $response->setValues($objects);
      }
      if ($oidStr != null && $subResponse->hasValue($oidStr)) {
        $object = $subResponse->getValue($oidStr);
        $response->setValue($oidStr, $object);
        if ($subResponse->getStatus() == 201) {
          $this->setLocationHeaderFromOid($oidStr);
        }
      }
      return true;
    }

    // in case of error, return default response
    $response->setErrors($subResponse->getErrors());
    $response->setStatus(400);
    return false;
  }