开始编写自己远程服务访问的测试代码??
O(∩_∩)O哈哈~休息片刻偶
package cn.com.huawei.socket.remote.rpc;
import cn.com.huawei.socket.commons.HelloService;
public class Test {
public static void main(String[] args) {
try {
Call call=new Call();
call.setClassName(HelloService.class.getSimpleName());
call.setMethodName("hello");
call.setParams(new Object[]{"xiaobai"});
call.setParamTypes(new Class[]{String.class});
RemoteServerProxyFactory serviceproxy=new RemoteServerProxyFactory(8000);
serviceproxy.service();
RemoteClientProxyFactory clientproxy=new RemoteClientProxyFactory(8000,"localhost",call);
clientproxy.invoke();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}