最近在公司负责了一个接口.它是通过hessian发布的,这里就遇到一个问题,怎样测试这个接口.既然作为服务类那么必须有文档公布它的接口形式,客户端用户在通过这个文档来生成代理类.
hessian 的代理类是直接通过factory得到的,所以我们先得获取到接口文件.
客户端代码:
String url = "localhost:8080/hessian/xxx";
HessianProxyFactory factory = new HessianProxyFactory();
Printer printer = (Printer) factory.create(Printer.class, url);
System.out.println("Hessian: " + printer.printstr());
具体请参考:http://note.youdao.com/share/?id=64e0ea4b4d4c574b404bef3454dc0f99&type=note#/