There are a couple options:
1) Instead of putting it on the cxf:bus, put it on each of the jaxws:endpoint
things you need it on.
2) Instead of an Interceptor, write your own AbstractFeature that only adds
the interceptors to Server's. Register the feature on the bus.
3) With 2.4, you can also use named bus's.
<cxf:bus name="client-bus">
...
</cxf:bus>
<cxf:bus name="server-bus">
....
</cxf:bus>
<jaxws:endpoint bus="server-bus">
....
Dan
On Tuesday, June 14, 2011 7:40:09 PM David Karlsen wrote:
> Hi.
>
> We use cxf both as a client calling others as well as providing server-side
> services in the same application.
> For the server side services we have a custom interceptor - this is however
> picked up by our client as well.
>
>
> The client config is (in a separate spring context file):
> <http:conduit name="*.http-conduit">
> <http:client
> ConnectionTimeout="${directdebiting.bwi.connectTimeout:2000}"
> ReceiveTimeout="${directdebiting.bwi.socketReadTimeout:6000}"
> AllowChunking="${directdebiting.bwi.allowChunking:false}" />
> </http:conduit>
>
> <jaxws:client id="ourWsClient"
> serviceClass="generated.cxf.blahbalah.ws.Blah...Port"
> address="${directdebiting.bwi.getcustomergroupsendpoint}">
> <jaxws:properties>
> <entry key="schema-validation-enabled"
> value="${ourClient.schemaValidation:false}" />
> </jaxws:properties>
> </jaxws:client>
>
>
> The serverside is in the standard cxf-servlet.xml config:
> <cxf:bus>
> <cxf:features>
> <cxf:logging />
> <ref bean="responseTimeFeature" />
> </cxf:features>
> <cxf:inInterceptors>
> <ref bean="contextHandlerInterceptor" />
> </cxf:inInterceptors>
> </cxf:bus>
> <bean id="responseTimeFeature"
> class="org.apache.cxf.management.interceptor.ResponseTimeFeature" />
>
> <bean id="CounterRepository"
> class="org.apache.cxf.management.counters.CounterRepository">
> <property name="bus" ref="cxf" />
> </bean>
>
> <!--and then a lot of jaxws:endpoint implementor=...." services as usual.
>
> How can I avoid the interceptor to be picked up by the client?
--
Daniel Kulp
[email protected]
http://dankulp.com/blog
Talend - http://www.talend.com