Search code examples
javajax-wscxfjava-metro-framework

JAX-WS Invoking a webservice using Implementation specific API such as CXF


Is it possible to invoke a web service in Java without using the JAX-WS API but a specific runtime implementation API such as CXF specific API?

I have Metro on my classpath an its causing issues when I use the JAX-WS API so I want to specify the exact JAX-WS API implementation to use dynamically when invoking the service

Thank u


Solution

  • Most likely, all the JAX-WS implementations have some sort of proprietary API that can be used to create services that would use their specific implementation and bypass the JAX-WS provider discovery mechanisms. In most cases, the discovered Providers are likely a wrapper onto those API's.

    For CXF on the client side, that would be the JaxWsProxyFactoryBean:

    http://cxf.apache.org/javadoc/latest/org/apache/cxf/jaxws/JaxWsProxyFactoryBean.html

    which can be used to create the Proxy objects from the JAX-WS generated interfaces.