Last active
December 16, 2015 07:19
-
-
Save jdennaho/5398253 to your computer and use it in GitHub Desktop.
set targetNamespace at runtime on JAX-WS proxy when using org.apache.cxf.jaxws.JaxWsProxyFactoryBean
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public <T> T getServiceClient(Class<T> interfaceClass, final String targetNamespace) { | |
JaxWsProxyFactoryBean interfaceFactory = new JaxWsProxyFactoryBean(); | |
interfaceFactory.setServiceFactory(new JaxWsServiceFactoryBean() { | |
@Override | |
protected OperationInfo createOperation(ServiceInfo serviceInfo, InterfaceInfo intf, Method m) { | |
intf.setName(new QName(targetNamespace, intf.getName().getLocalPart())); //overwrite the default namespace with target | |
return super.createOperation(serviceInfo,intf,m); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment