You can define the interceptors on the jaxws:endpoint instead of the cxf bus. 
That should do the trick.

Christian


-----Ursprüngliche Nachricht-----
Von: Rainer Gall [mailto:[email protected]] 
Gesendet: Montag, 30. Mai 2011 11:44
An: [email protected]
Betreff: How can I reduce the usage of my interceptors

We have been developing several webservices running on the same server.

Now we have the need to do some more ore less complex logging tasks in an 
interceptor. 

To avoid, that the interceptor is called whenever any of our webservices is 
called, it would be helpful to reduce the usage of this interceptor to a 
specific endpoint.

The following configuration file is a shortened example.
We would like to use MySpecialInterceptor only within the 
VapRequestService-endpoint.

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans";
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:jaxws="http://cxf.apache.org/jaxws";
        xmlns:cxf="http://cxf.apache.org/core";
        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/schemas/jaxws.xsd 
                        http://cxf.apache.org/core 
http://cxf.apache.org/schemas/core.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" />
        
        <jaxws:endpoint id="VehicleContractService"
                
implementor="de.webservice.contractvehicle.VehicleContractServiceImpl"
                address="/vehiclecontractservice" publish="true" />

        <jaxws:endpoint id="VehicleServiceV200"
                
implementor="de.webservice.objectmanagement.v200.VehicleServiceImpl"
                address="/v200/vehiclecontractservice" publish="true" />

        <jaxws:endpoint id="VapRequestService"
                implementor="de.webservice.vap.request.VapRequestServiceImpl"
                address="/vaprequestservice" publish="true" />

        

                        
        <bean id="WSTransactionInterceptor"
                
class="de.tecframe.webservice.interceptor.WSTransactionInterceptor" />
        <bean id="WSCleanUpInterceptor"
                class="de.tecframe.webservice.interceptor.WSCleanUpInterceptor" 
/>
        <bean id="InboundLogInterceptor"
                
class="de.tecframe.webservice.interceptor.InboundLogInterceptor" />
        <bean id="OutboundLogInterceptor"
                
class="de.tecframe.webservice.interceptor.OutboundLogInterceptor" />
        <bean id="OutboundFaultInterceptor" 
                
class="de.tecframe.webservice.interceptor.OutboundFaultInterceptor" />
        <bean id="MySpecialInterceptor" 
                class="de.webservice.vap.request.MySpecialInterceptor"/>
                
        
        <cxf:bus>
                <cxf:inInterceptors>
                        <ref bean="WSTransactionInterceptor" />
                        <ref bean="InboundLogInterceptor" />
                        <ref bean="MySpecialInterceptor"/>
                </cxf:inInterceptors>
                <cxf:outInterceptors>
                        <ref bean="WSCleanUpInterceptor" />
                        <ref bean="OutboundLogInterceptor" />
                </cxf:outInterceptors>
                <cxf:outFaultInterceptors>
                        <ref bean="WSCleanUpInterceptor" />
                        <ref bean="OutboundFaultInterceptor" />
                </cxf:outFaultInterceptors>
        </cxf:bus>

</beans>


Actually I check this within the handleMessage-Method by testing the BASE_PATH

        public void handleMessage(Message message) throws Fault {
                String lcPath = (String) message.get(Message.BASE_PATH);
                // handelt es sich um einen vaprequestservice
                if (lcPath.indexOf("vaprequestservice") > -1) {

Is there any way to reduce the usage of MySpecialInterceptor within the 
configuration-file?

Regards,
Rainer




--
View this message in context: 
http://cxf.547215.n5.nabble.com/How-can-I-reduce-the-usage-of-my-interceptors-tp4438857p4438857.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to