Ejemplo n.º 1
0
declare(encoding = 'UTF-8');

use de\RaumZeitLabor\PartKeepr\Service\ServiceManager;
use de\RaumZeitLabor\PartKeepr\PartKeepr;

include("../src/de/RaumZeitLabor/PartKeepr/PartKeepr.php");

PartKeepr::initialize("");

try {
	$request = $_REQUEST;
	$request["parameters"] = json_decode($_REQUEST["parameters"], true);
	
	$response = array();
	$response["status"] = "ok";
	$response["response"] = ServiceManager::call($request);
	
	echo json_encode($response);
	
} catch (de\RaumZeitLabor\PartKeepr\Util\SerializableException $e) {
	$response = array();
	$response["status"] = "error";
	$response["exception"] = $e->serialize();
	
	echo json_encode($response);
} catch (\Exception $e) {
	$response = array();
	$response["status"] = "systemerror";
	$response["exception"] = get_class($e);
	$response["message"] = $e->getMessage();
	$response["backtrace"] = $e->getTraceAsString();
Ejemplo n.º 2
0
 * 
 * /Part specifies that you wish to call the Part service. The service manager automatically extends the short "Part"
 * name to the class de\RaumZeitLabor\PartKeepr\Part\PartService.
 * 
 * REST
 * ====
 * 
 * Each service which implements the RESTful interface operates on the POST, PUT, GET and DELETE
 * HTTP verbs. Those are mapped to the get(), create(), update() and destroy() methods.
 * 
 */
try {
	$response = array();
	$response["status"] = "ok";
	$response["success"] = true;
	$response["response"] = ServiceManager::call();
	
	echo json_encode($response);
	
} catch (\de\RaumZeitLabor\PartKeepr\Util\SerializableException $e) {
	header('HTTP/1.0 400 Exception', false, 400);
	$response = array();
	$response["status"] = "error";
	$response["exception"] = $e->serialize();
	echo json_encode($response);
} catch (\Exception $e) {
	header('HTTP/1.0 400 Exception', false, 400);
	$response = array();
	$response["status"] = "systemerror";
	$response["exception"] = array(
		"message" => $e->getMessage(),
Ejemplo n.º 3
0
	}
}*/

/*$server = new SoapServer("test.wsdl", array("cache_wsdl" => WSDL_CACHE_NONE, "classmap" => array("User" => "User")));
$server->setClass("UserService");
$server->handle();*/








$callStruct = array(
	"service" 	=> "de.RaumZeitLabor.PartKeepr.Auth.AuthManagerService",
	"call"		=> "login",
	"parameters"	=> array(
		"username" => "2test",
		"password" => "098f6bcd4621d373cade4e832627b4f6"
					)
);

ServiceManager::call($callStruct);





PartKeepr::getEM()->flush();
?>