private static <T> T getHttpInvokerService(String serverUrl, Class<T> serviceInterface) {
HttpInvokerProxyFactoryBean httpInvoker = new HttpInvokerProxyFactoryBean();
httpInvoker.setServiceInterface(serviceInterface);
httpInvoker.setServiceUrl(serverUrl);
httpInvoker.afterPropertiesSet();
return (T) httpInvoker.getObject();
}
public static void main(String[] args){
ITestService service = getHttpInvokerService("http://localhost:8080/remoting/ITestService",ITestService.class);
System.out.println(service.getName());
}