It is not an easy thing to do, unless you write a handler to edit the message context and remove that phase for the particular invocation you want. (This is doable, but Axis2 does not support this by default)
Deepal > Hey there, > > I'm trying to dynamically skip a phase. Let me explain. > Let's say I have defined the following phases as InFlow: Transport, > Security, Dispatch, OperationInPhase. I want to skip the Security > phase in some cases, in other words I want the phase order to become > [Transport, Dispatch, OperationInPhase]. > > I've tried to insert my decision test (skip Security or not?) into the > method Phase#checkPreconditions of a new Phase subclass, but it > wouldn't work. Actually if an AxisFault is thrown in > Phase#checkPreconditions, all the following phases are skipped. Cf. > AxisEngine#invoke. > > My next idea was to override Phase#invoke, insert my test and > eventually delegate to the super method implementation. Unfortunately, > Phase#invoke is marked as final. :( > > Then I tried to decorate a Phase in an handler implementation, but > this is a dead end as well because a Phase instance is required by > AxisConfigBuilder#getPhase. > > At this point, I ran out of ideas. That's why my asking for your help > guys. I hope you will have a solution for my use case. > > Thanks in advance. > > Alexis > -- Thank you! http://blogs.deepal.org http://deepal.org
