echo "Error: " . $e->getMessage(); exit; } } // NOTE: DATA ITEM 'DECLARATIONS' // new data items needed must be given a variable name // and added to this list of variables. The php variable name should // match the POST name $resultObj = array(); $resultStr = ""; $debuglog = ""; $department = isset($_POST["department"]) ? $_POST["department"] : ""; $transtype = isset($_POST["transtype"]) ? $_POST["transtype"] : ""; $symbol = isset($_POST["symbol"]) ? $_POST["symbol"] : ""; $shares = isset($_POST["shares"]) ? $_POST["shares"] : ""; $limitprice = isset($_POST["limitprice"]) ? $_POST["limitprice"] : ""; $orderid = isset($_POST["orderid"]) ? $_POST["orderid"] : ""; $username = isset($_POST["username"]) ? $_POST["username"] : ""; $password = isset($_POST["password"]) ? $_POST["password"] : ""; $currentcash = isset($_POST["currentcash"]) ? $_POST["currentcash"] : ""; // END of variable declaration list // $transtype holds the name of the behavior you would like to call // NOTE: DATA ITEM ACTUAL PARAMETERS // variables for new data items must be added to the end of the list of // actual parameters passed to callService below if (strlen($transtype) > 0) { $resultStr = callService($debuglog, $department, $transtype, $symbol, $shares, $limitprice, $orderid, $username, $password, $currentcash); // END of parameters passed to callService $resultObj = json_decode($resultStr); //null if error }
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Teste de WebService Sistema Aula - Função: </title> </head> <body> <?php require '../lib/clientewebservice.php'; require '../config.php'; // grupo de informações solicitadas para execução do serviço $action = "sistemaaula_grade_get_final_grade_by_user_id_and_course_id"; $courserid = 2; // atualize com o codigo do seu curso $userid = 3; // atualize com o codigo do usuário $param = array($userid, $courserid); $resp = callService($host, $install, $token, $action, $param); print_r($resp); ?> </body> </html>