hessian(5)-TestHessian 接口调用

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);

    }


}

猜你喜欢

转载自blog.csdn.net/xinyu100100/article/details/80629460
今日推荐