The jbossws-cxf ServiceObjectFactory needs to be cleaned:
- Bus retrieval: this is currently performed through reflection on the Service class and following cast to cxf ServiceImpl; leveraging the BusFactory should be enough to get the default bus that is used by the cxf ProviderImpl for every Service creation
- ServiceRef stub properties setup: this is currently performed through reflection on Service class to get the ServiceDelegate and then changing the ServiceDelegate instance at runtime with a custom one that sets the properties. Instead of doing this hack, we should evaluate leveraging the CXF configuration for runtime constructed objects (http://cwiki.apache.org/CXF20DOC/configuration-of-runtime-constructed-objects.html). IOW cxf ServiceImpl looks for a bean named portName.toString() + ".jaxws-client.proxyFactory" to configure the JaxWsProxyFactoryBean used to build the port and that factory bean allows for setting the stub properties. We might be able to generate on the fly and supply a bean configuration to the cxf bus for having our stub properties automatically configured by the already existing cxf configuration system.
- perhaps even the handler chain configuration can be achieved in a way similar to the described in the previous point.