Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

By creating a bus with your own bean configuration file, i.e. using the factory method

Code Block
SpringBeanFactorySpringBusFactory.createBus("mycxf.xml")

you can complement or overwrite the bean definitions that CXF would use by default. In this case mycxf.xml must be on the classpath, but you can also use a factory method taking a URL that points to your bean configuration file.

For example, by replacing the bus bean defined in cxf.xml with this bean in your configuration file:

Code Block

<bean id="cxf" class="org.apache.cxf.bus.spring.SpringBus">
    <property name="outInterceptors">
           <list>
              <ref bean="myLoggingInterceptor"/>
           </list>
        </property>
</bean>

<bean id="myLogHandler" class="org.mycompany.com.cxf.logging.LoggingInterceptor">
    ...
</bean>

...