import java.net.MalformedURLException;
import java.util.HashMap;
import java.util.Map;
import com.caucho.hessian.client.HessianProxyFactory;
import com.suning.logistics.eds.hessian.invoke.MapRemoteInvoke;
public class TestHessian {
@org.testng.annotations.Test
public void test() throws MalformedURLException, ClassNotFoundException{
String url = "http://120.0.0.1:8080/TestWeb/hessian/invokeServer";
HessianProxyFactory pf = new HessianProxyFactory();
MapRemoteInvoke da = (MapRemoteInvoke) pf.create(url);
Map<String,Object> params = new HashMap<String, Object>();
params.put("beanId", "beanId");
params.put("methodName", "methodName");
params.put("test", "123");
Map<?, ?> result = da.remoteInvoke(params);
System.out.println(result);
}
}
hessian(5)-TestHessian 接口调用
最新推荐文章于 2022-08-05 15:15:58 发布