/**
 * Mock validation service.
 *
 * All services must send back:
 * 1. An HTTP return code indicating the outcome of the service. This codes is
 * then interpreted by the Core based on the extension configuration to further
 * route the request.
 * 2. A body consisting of a raw string with the input data transformed, OR
 * an empty result (such as in the case of this example, where data is not
 * manuipulated).
 */
// Execute main method.
//echo "Validation service";
$m = new ValidationService();
$m->main();
/**
 * Validation class.
 *
 * It only implements two validation methods: data type and cardinality.
 */
class ValidationService
{
    function main()
    {
        if ($this->validate()) {
            echo "\nValidation: Validation pass.";
            http_response_code(204);
        } else {
            echo "\nValidation: Validation failed.";
            http_response_code(412);