String sessionId;
{
HttpInvokerProxyFactoryBean httpInvokerProxyFactoryBean = new HttpInvokerProxyFactoryBean();
httpInvokerProxyFactoryBean.setServiceInterface(LoginService.class);
httpInvokerProxyFactoryBean.setServiceUrl(LOGIN_SERVICE);
httpInvokerProxyFactoryBean.setHttpInvokerRequestExecutor(new CommonsHttpInvokerRequestExecutor());
httpInvokerProxyFactoryBean.afterPropertiesSet();
LoginService loginService = (LoginService)httpInvokerProxyFactoryBean.getObject();
sessionId = loginService.doLogin("userXXXX", "passXXXX");
assertNull(sessionId);
}
{
final HttpInvokerProxyFactoryBean httpInvokerProxyFactoryBean = new HttpInvokerProxyFactoryBean();
httpInvokerProxyFactoryBean.setServiceInterface(CopperMonitoringService.class);
httpInvokerProxyFactoryBean.setServiceUrl(COPPER_MONITORING_SERVICE);
httpInvokerProxyFactoryBean.setRemoteInvocationFactory(new SecureRemoteInvocationFactory(sessionId));
httpInvokerProxyFactoryBean.setHttpInvokerRequestExecutor(new CommonsHttpInvokerRequestExecutor());
httpInvokerProxyFactoryBean.afterPropertiesSet();
CopperMonitoringService copperMonitorService = (CopperMonitoringService)httpInvokerProxyFactoryBean.getObject();
assertNotNull(copperMonitorService);