...
Code Block |
---|
|
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cxf="http://cxf.apache.org/core"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd">
<bean id="MyInterceptor" class="demo.interceptor.MyInterceptor"/>
<!-- We are adding the interceptors to the bus as we will have only one endpoint/service/bus. -->
<cxf:bus>
<cxf:inInterceptors>
<list>
<ref bean="MyInterceptor"/>
</list>
</cxf:inInterceptors>
<cxf:outInterceptors>
<list>
<ref bean="MyInterceptor"/>
</list>
</cxf:outInterceptors>
</cxf:bus>
</beans>
You start your server using -Dcxf.config.file=server.xml to specify the configuration file.
|
Adding MyInterceptor to your client:
Code Block |
---|
|
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:http="http://cxf.apache.org/transports/http/configuration"
xsi:schemaLocation="http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<http:conduit name="{http://apache.org/hello_world_soap_http}SoapPort9001.http-conduit">
<http:client DecoupledEndpoint="http://localhost:9990/decoupled_endpoint"/>
</http:conduit>
<bean id="MyInterceptor" class="demo.interceptor.MyInterceptor"/>
<!-- We are adding the interceptors to the bus as we will have only one endpoint/service/bus. -->
<bean id="cxf" class="org.apache.cxf.bus.CXFBusImpl">
<property name="inInterceptors">
<list>
<ref bean="MyInterceptor"/>
</list>
</property>
<property name="outInterceptors">
<list>
<ref bean="MyInterceptor"/>
</list>
</property>
</bean>
</beans>
|
You start your client using -Dcxf.config.file=client.xml to specify the configuration file.