michaelf
Apr 16th, 2012, 04:57 PM
The issue is discussed couple of times, but I was not able to find a solution that solves our problem.
We have the following HttpInvoker service that takes the remote URL from Database:
@Service("exampleService")
public class ExampleHttpInvoker extends HttpInvokerProxyFactoryBean {
@Resource
private DBService service;
@PostConstruct
public void init() throws ConfigurationException {
String url = service.getURL();
this.setServiceUrl(url);
this.setServiceInterface(RemoteInterface.class);
this.setHttpInvokerRequestExecutor(new CommonsHttpInvokerRequestExecutor());
afterPropertiesSet();
}
}
The URL can be changed between remote calls.
How to replace serviceUrl at runtime?
We can not use Session or Request scope since the service is not Web aware.
Any help will be appreciated.
We have the following HttpInvoker service that takes the remote URL from Database:
@Service("exampleService")
public class ExampleHttpInvoker extends HttpInvokerProxyFactoryBean {
@Resource
private DBService service;
@PostConstruct
public void init() throws ConfigurationException {
String url = service.getURL();
this.setServiceUrl(url);
this.setServiceInterface(RemoteInterface.class);
this.setHttpInvokerRequestExecutor(new CommonsHttpInvokerRequestExecutor());
afterPropertiesSet();
}
}
The URL can be changed between remote calls.
How to replace serviceUrl at runtime?
We can not use Session or Request scope since the service is not Web aware.
Any help will be appreciated.