You would probably need to write your own interceptor that would
determine the appropriate configuration and then adds that to the chain.
Basically, write an interceptor that does:
public void handleMessage(Message message) {
SOAPMessage msg = message.getContent(SOAPMessage.class);
if (messageConformsToA(msg)) {
message.getInterceptorChain().add(wss4jAInterceptor);
} else {
message.getInterceptorChain().add(wss4jBInterceptor);
}
}
You would then configure your interceptor in the chains in the spring
config.
Enjoy!
Dan
On Tuesday 16 October 2007, Mayank Mishra wrote:
> Hi all,
>
> I understand the way of plugging in In and Out Interceptors to CXF bus
> like,
>
> <bean id="cxf" class="org.apache.cxf.bus.CXFBusImpl">
> <property name="inInterceptors">
> <list>
> <ref bean="SAAJInInterceptor"/>
> <ref bean="WSS4JInConfiguration"/>
> </list>
> </property>
> <property name="outInterceptors">
> <list>
> <ref bean="SAAJOutInterceptor"/>
> <ref bean="WSS4JOutConfiguration"/>
> </list>
> </property>
> </bean>
> <bean id ="WSS4JIn..
> <bean id = "WSS4JOut...
> ...
>
> We can specify a set of configuration inside each of WSS4J In and Out
> interceptors.
>
> My requirement is to specify an alternative configuration also along
> with this configuration. So, if service configured for configuration A
> and B. If the incoming message adheres to Configuration B rather than
> A, CXFBus can pass the message to WSSInInterceptor configured for B
> configuration, without WSSInInterceptor A giving Security Failure.
>
> Is it somehow feasible using CXF Spring Configuration or the way we
> specify Interceptors to CXFBus?
>
> With Regards,
> Mayank
--
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727 C: 508-380-7194
[EMAIL PROTECTED]
http://www.dankulp.com/blog