Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Note
titleChanges in CXF 2.4.x

The below is applicable for CXF versions 2.3.x and older. Starting in CXF 2.4.0, the extensions are loaded internally by CXF automatically and you do not need to import all the cxf-extension-*.xml file. You only need to import classpath:META-INF/cxf/cxf.xml.

You can embed CXF within an existing Spring application. Since all XML configuration files are Spring xml files, the two approaches should be equivalent.

CXF includes Spring configuration files which configure the various CXF modules. You will want to import these into your application. Here is an example that imports the core CXF components, the SOAP binding, and the servlet transport:

Code Block
xml
xml

<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:jaxws="http://cxf.apache.org/jaxws"
	xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schema/jaxws.xsd">

	<import resource="classpath:META-INF/cxf/cxf.xml" />
	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
	<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
  ...
</beans>

To include all the CXF modules you can use cxf-all or a wildcard expression:

Code Block
xml
xml

<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:jaxws="http://cxf.apache.org/jaxws"
	xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schema/jaxws.xsd">

	<import resource="classpath:META-INF/cxf/cxf.xml" />
	<import resource="classpath*:META-INF/cxf/cxf-extension-*.xml" />
  ...
</beans>

...

This mailing list thread provides more information on CXF Spring files that may need to be imported in your web.xml.

...

titleChanges in CXF 2.4.x

...