PHP100 2019-03-27
代码如下:
<?php include_once('HessianPHP/dist/HessianService.php'); class HelloWorldService { public function __construct() { } public function add($a, $b) { return $a+$b; } } $wrapper = new HessianService(); $wrapper->registerObject(new HelloWorldService); $wrapper->displayInfo = true; $wrapper->service(); ?>
代码如下:
<?php require_once 'HessianPHP/dist/HessianClient.php'; Hessian::errorReporting(HESSIAN_SILENT); $url = 'http://localhost/info.php'; $proxy = & new HessianClient($url); $sum = $proxy->add(3, 5); echo $sum; if(Hessian::error()) { $errors = Hessian::error(); print_r($erros->message); //var_dump($errors); } ?>
<?php. if (!empty($_POST)) {. $data1 = $_POST["data1"];$data2 = $_POST["data2"];$fuhao = $_POST["fuh