下载HessianPHP_v2.0.3.zip
下载地址:http://sourceforge.net/projects/hessianphp/
(不要使用HessianPHP-1.0.5-RC2.zip, 2006年后没有更新了,不支持php5.2以后,及最新hessian协议.
注意:需要注意服务器端发布的hessian协议版本,客户端要与之对应.)
使用例子在:HessianPHP_v2.0.3.zip\quickstart.txt
http://localhost/mathService.php
http://localhost/mathClient.php
其中,涉及三个文件:
Math.php
<?php
class Math{
}
==========================
mathService.php
<?php
include_once ‘Math.php’;
include_once ‘hessianphp/HessianService.php’;
$service = new HessianService(new Math());
$service->handle();
==========================
mathClient.php
<?php
include_once ‘hessianphp/HessianClient.php’;
$testurl = ‘http://localhost/yii/testdrive/mathService.php’;
$proxy = new HessianClient($testurl);
try{
} catch (Exception $ex){
}
另外,在运行的时候,需要打开php的CURL扩展:C:\xampp\php\php.ini
extension=php_curl.dll
未经允许不得转载:天宝寺||陈瑞轩 » hessianphp的使用