Ejemplo n.º 1
0
//===================================================================//
// Main Routine                                                      //
//===================================================================//
// Construct the request manager.
$rqManager = new RequestManager();
// Determine the incoming request type.
if ($rqManager != Null) {
    switch ($_SERVER['REQUEST_METHOD']) {
        case 'GET':
            $inputData =& $_GET["request"];
            break;
        case 'POST':
            $inputData =& $_POST["request"];
            break;
        default:
            echo '{ "Response" : "InvalidData" }';
            exit;
            break;
    }
    $inputData = json_decode($inputData, True);
    if ($inputData != NULL || $inputData != false) {
        $responseObj = $rqManager->callService($inputData);
        $rqManager->returnResult($responseObj);
    } else {
        echo '{ "Response" : "InvalidData" }';
    }
} else {
    echo '{ "Response" : "InvalidData" }';
    exit;
}
//-------------------------------------------------------------------//