Exemplo n.º 1
0
// end of parsing parameters
// initialize defaults for the ones not set or not set right but with default values
if ($output != 'html' && $output != 'rest') {
    $output = DEFAULT_WEB_SERVICE_OUTPUT;
}
// end of initialization
// validate parameters
if ($uri == '') {
    $errors[] = 'AC_ERROR_EMPTY_URI';
}
if ($web_service_id == '') {
    $errors[] = 'AC_ERROR_EMPTY_WEB_SERVICE_ID';
} else {
    // validate web service id
    $usersDAO = new UsersDAO();
    $user_row = $usersDAO->getUserByWebServiceID($web_service_id);
    if (!$user_row) {
        $errors[] = 'AC_ERROR_INVALID_WEB_SERVICE_ID';
    } else {
        $user_id = $user_row['user_id'];
    }
}
if (!is_array($decisions)) {
    $errors[] = 'AC_ERROR_SEQUENCEID_NOT_GIVEN';
}
// return errors
if (is_array($errors)) {
    if ($output == 'rest') {
        echo RESTWebServiceOutput::generateErrorRpt($errors);
    } else {
        echo HTMLRpt::generateErrorRpt($errors);