It would be nice to have an easy way to set the reference endpoint at runtime for every call.
Use cases:
To allow to configure different endpoint per environment, so there is no need to recompile the application or use System.property to set endpoints.
To allow a service to invoke different endpoints depending on a "logic" in a component.
To provide with greater flexibility on service creation.
For this, an option could be to provide hook points in the OutboundHandler so the endpoint for the ServiceReference that has been set-up through the configuration can be obtained from some other place.
E.g:
String toAddress = SOAPUtil.getToAddress(exchange.getContext());
if (address == null){ // This means there is no Addressing, so endpoint can be overwritten if configured
toAddress = InjectAddressFromCache(); // Probably with a hook point could be better, to be able to set toAddress depending on ServiceName or whatever
}
if (toAddress != null) {
_dispatcher.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, toAddress);
}
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira