[英]Separate cxf interceptor configuration for clients vs. services?
I have some Web Services running using Apache CXF, with a particular custom outbound interceptor registered using cxf:outInterceptors. 我有一些使用Apache CXF运行的Web服务,并使用cxf:outInterceptors注册了特定的自定义出站拦截器。 This interceptor is intended to be executed as the response goes back to the Web Service client.
该拦截器旨在在响应返回到Web Service客户端时执行。
<cxf:bus>
<cxf:outInterceptors>
<ref bean="myCustomInterceptorOutbound" />
</cxf:outInterceptors>
<cxf:inInterceptors>
</cxf:inInterceptors>
<cxf:features>
<cxf:logging />
</cxf:features>
</cxf:bus>
However, if one of my Web Services ends up calling a separate remote Web Service, I don't want that outbound interceptor to be invoked in that case. 但是,如果我的Web服务之一最终调用了单独的远程Web服务,那么我不希望在这种情况下调用该出站拦截器。
Is there a way to specify different interceptor configuration for a jaxws:client (or JaxWsProxyFactoryBean), ie to tell to "not use" the interceptor registered via cxf:bus? 有没有办法为jaxws:client(或JaxWsProxyFactoryBean)指定不同的拦截器配置,即告诉“不使用”通过cxf:bus注册的拦截器? Or do I need to remove the interceptor from cxf:bus and register it individually on each jaxws:endpoint?
还是我需要从cxf:bus中删除拦截器并在每个jaxws:endpoint上分别注册?
Add interceptors individually per client / server. 每个客户端/服务器分别添加拦截器。 For example
例如
<jaxws:client
serviceClass="no.bring.booking.Booking"
address="${bring.booking.webservice}" id="booking">
<jaxws:inFaultInterceptors>
<ref bean="loggingInInterceptor" />
</jaxws:inFaultInterceptors>
<jaxws:inInterceptors>
<bean class="com.greenbird.xmlformatter.cxf.LoggingInInterceptor">
<property name="prettyLogging" value="true" />
<property name="prettyPrinter" ref="prettyPrinter" />
</bean>
</jaxws:inInterceptors>
<jaxws:outInterceptors>
<bean class="com.greenbird.xmlformatter.cxf.LoggingOutInterceptor">
<property name="prettyLogging" value="true" />
<property name="prettyPrinter" ref="prettyPrinter" />
</bean>
</jaxws:outInterceptors>
<jaxws:outFaultInterceptors>
<ref bean="loggingOutInterceptor" />
</jaxws:outFaultInterceptors>
</jaxws:client>
and share some interceptors by declaring them as beans. 并通过将它们声明为bean来共享一些拦截器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.