Difference between Apache CXF and Axis

Keep in mind, I’m completely biased (PMC Chair of CXF), but my thoughts: From a strictly “can the project do what I need it to do” perspective, both are pretty equivalent. There some “edge case” things that CXF can do that Axis 2 cannot and vice versa. But for 90% of the use cases, either … Read more

JAX-WS = When Apache CXF is installed it “steals” default JDK JAX-WS implementation, how to solve?

Apache CXF (cxf-rt-frontend-jaxws-*.jar to be precise) registers itself as a JAX-WS provider in the JVM. Inside the aforementioned JAR there is a file named: /META-INF/services/javax.xml.ws.spi.Provider with the following contents: org.apache.cxf.jaxws.spi.ProviderImpl If you now look at javax.xml.ws.spi.FactoryFinder#find method you will discover that JDK searches the CLASSPATH for the presence of javax.xml.ws.spi.Provider file and falls back to … Read more

Extended server_name (SNI Extension) not sent with jdk1.8.0 but send with jdk1.7.0

As mentioned, the cause is related to the JDK bug where using setHostnameVerifier() breaks SNI (Extension server_name). https://bugs.openjdk.java.net/browse/JDK-8144566 Our workaround: After testing we found that setting a connection’s SSLSocketFactory to just about anything from the default seems to fix the issue. This does not work: HttpsURLConnection.setSSLSocketFactory((SSLSocketFactory) SSLSocketFactory.getDefault()); This does work: HttpsURLConnection.setSSLSocketFactory(new SSLSocketFactoryFacade()); So, to fix … Read more

How to avoid the need to specify the WSDL location in a CXF or JAX-WS generated webservice client?

I finally figured out the right answer to this question today. <plugin> <groupId>org.apache.cxf</groupId> <artifactId>cxf-codegen-plugin</artifactId> <version>${cxf.version}</version> <executions> <execution> <id>generate-sources</id> <phase>generate-sources</phase> <configuration> <sourceRoot>${project.build.directory}/generated-sources/cxf</sourceRoot> <wsdlOptions> <wsdlOption> <wsdl>${project.basedir}/src/main/resources/wsdl/FooService.wsdl</wsdl> <wsdlLocation>classpath:wsdl/FooService.wsdl</wsdlLocation> </wsdlOption> </wsdlOptions> </configuration> <goals> <goal>wsdl2java</goal> </goals> </execution> </executions> </plugin> Notice that I have prefixed the value in wsdlLocation with classpath:. This tells the plugin that the wsdl will be on … Read more