Home > Backend Development > PHP Tutorial > Detailed introduction to php hessian_PHP tutorial

Detailed introduction to php hessian_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 17:08:17
Original
850 people have browsed it

What is hessian?
When I saw this word, I didn’t know how to pronounce it. The phonetic symbol is [hes] pronounced Heisen.
Hessian is a lightweight remote data exchange tool that provides the function of RMI (remote method invocation) using a simple method. Compared with webservice, hessian is simpler and faster. The binary rpc protocol is used. Because it is a binary protocol, it is very suitable for sending binary data
hessian is language independent.
2. How to use it in the php tutorial?
Do you think this can be used just like soap by opening one in php.ini? I think so too. Yes
What I'm here to tell you is that it's wrong to think so.
You need to download a hessianphp library to use.
Download address http://hessianphp.sourceforge.net/
3. See how to use it.
1. Server side.
Copy the code. The code is as follows:
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();
?>

Server side results

2. Client
Copy the code. The code is as follows:
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);
}
?>

client results

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/629851.htmlTechArticleWhat is hessian? When I saw this word, I didn’t know how to pronounce it. The phonetic symbol is [hes] pronounced Heisen. hessian is a lightweight remote data exchange tool that provides...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template