搜索
首页php教程php手册php hessian详细介绍

php hessian详细介绍

Jun 13, 2016 am 10:10 AM
php介绍单词怎么是什么详细这个

hessian是什么?
看到这个单词我还不知道怎么读,音标是[hes]读黑森。
hessian是一个轻量级的远程的数据交换工具,使用简单的方法提供了rmi(远程方法调用)的功能. 相比webservice,hessian更简单、快捷。采用的是二进制rpc协议,因为采用的是二进制协议,所以它很适合于发送二进制数据
hessian是独立于语言的。
二、在php教程中怎么用的呢?
你是不是认为这个和soap一样在php.ini中开启一个就可以使用了,我也这么认为的。可
是我要告诉你的是这样的想法是错误的。
需要去下载一个hessianphp的库来使用。
下载地址http://hessianphp.sourceforge.net/
三、看看怎么使用。
1、服务器端。
复制代码 代码如下:
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();
?>

服务器端结果

2、客户端
复制代码 代码如下:
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结果

声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

Video Face Swap

Video Face Swap

使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热门文章

热工具

Dreamweaver Mac版

Dreamweaver Mac版

视觉化网页开发工具

SublimeText3 英文版

SublimeText3 英文版

推荐:为Win版本,支持代码提示!

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

功能强大的PHP集成开发环境

禅工作室 13.0.1

禅工作室 13.0.1

功能强大的PHP集成开发环境

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具