hessian(5)-TestHessian 接口调用

xiaoxiao2021-02-28  40

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); } }
转载请注明原文地址: https://www.6miu.com/read-2619998.html

最新回复(0)