首页>代码>apache hessian原理学习和自己实现rpc远程调用实例代码>/hessian-study/modules/hessian-study-server/src/main/java/com/jzx/hessian/client/HessianClient.java
package com.jzx.hessian.client;
import java.net.MalformedURLException;
import com.caucho.hessian.client.HessianProxyFactory;
import com.jzx.hessian.server.SayHelloService;
import com.jzx.hessian.vo.UserVo;
public class HessianClient {
public static void main(String[] args) throws MalformedURLException, ClassNotFoundException {
String url = "http://localhost:8080/hessian-study-server/helloworld";
HessianProxyFactory pf = new HessianProxyFactory();
SayHelloService da = (SayHelloService) pf.create(url);
System.out.println(da.sayHello("hessian ", "welcome"));
UserVo vo = da.sayHello1("小明", "男");
System.out.println("姓名:" + vo.getName() + " 性别:" + vo.getSex());
}
}
最近下载更多

最近浏览