最近在使用spring集成的httpinvoker和hessian做项目,这两个远程调用方案支持注册远程回调机制不?
我使用Java RMI貌似可以,httpinvoker和hessian老是配不通啊,郁闷,求高手解决。谢谢!大体的例子是这样的
服务端:
定义回调接口
interface ILoginCallback {
void onLogin(String userName);
}定义服务接口(用于远程服务调用)
interface IRemoteService {
boolean registerLoginNotify(ILoginCallback callback);
}客户端:
实现回调接口(向远程服务注册)
class MyLoginCallback implements ILoginCallback {
void onLogin(String userName) {
LOG("用户: '" + userName + "'登陆");
}
}客户端调用过程
MyLoginCallback callback = new MyLoginCallback();
IRemoteService remoteService = getRemoteService();------------通过spring获取该远程接口对象
remoteService.registerLoginNotify(callback); ------------运行时客户端提示"HTTP 500";服务端提示无法找到
MyLoginCallback对象
我使用Java RMI貌似可以,httpinvoker和hessian老是配不通啊,郁闷,求高手解决。谢谢!大体的例子是这样的
服务端:
定义回调接口
interface ILoginCallback {
void onLogin(String userName);
}定义服务接口(用于远程服务调用)
interface IRemoteService {
boolean registerLoginNotify(ILoginCallback callback);
}客户端:
实现回调接口(向远程服务注册)
class MyLoginCallback implements ILoginCallback {
void onLogin(String userName) {
LOG("用户: '" + userName + "'登陆");
}
}客户端调用过程
MyLoginCallback callback = new MyLoginCallback();
IRemoteService remoteService = getRemoteService();------------通过spring获取该远程接口对象
remoteService.registerLoginNotify(callback); ------------运行时客户端提示"HTTP 500";服务端提示无法找到
MyLoginCallback对象
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货