Can you expand your idea?
I would put this AbstractPhaseInterceptor in here :
<cxf:bus>
<cxf:features>
<p:policies />
<cxf:logging />
</cxf:features>
<cxf:outInterceptors>
<ref bean="RefToAbstractPhaseInterceptorBean" />
</cxf:outInterceptors>
</cxf:bus>
and the constructor of this class would be like :
public SecurityCxfInterceptor()
{
super(Phase.PRE_PROTOCOL); // should I need to call super with this
kind of parameter?
this.addAfter(SecurityCxfInterceptor.class.getName());
}
On Fri, Oct 18, 2013 at 5:56 PM, DSL <[email protected]> wrote:
> Thomas,
>
> You just need to create a class that extends AbstractPhaseInterceptor
> and add this in your constructor:
>
> addAfter( WSS4JOutInterceptro.class.getName() );
>
>
> On Fri, Oct 18, 2013 at 11:04 AM, Thomas Manson
> <[email protected]>wrote:
>
> > Hi,
> >
> > I'm trying to call a webservice and dynamically change the username.
> >
> > To do that I've tried to add a CXF interceptor that would update the
> > current username setted by WSS4JOutInterceptor.
> >
> > Unfortunately, I didn't succeed to make my interceptor to get executed
> > after WSS4JOutInterceptor so the SoapHeader is empty.
> >
> > I've tried that :
> >
> > public class SecurityCxfInterceptor extends AbstractSoapInterceptor
> >
> > {
> >
> > public SecurityCxfInterceptor()
> >
> > {
> >
> > super(Phase.PRE_PROTOCOL);
> >
> >
> >
> > // this.getAfter().add(SAAJOutInterceptor.class.getName());
> >
> > // this.getBefore().add(WSS4JOutInterceptor.class.getName());
> >
> > this.addAfter(SecurityCxfInterceptor.class.getName());
> >
> > }
> >
> > with this spring configuration
> >
> >
> > <bean id="SecurityCxfInterceptor"
> > class="com.tibco.cts.amxbpm.fwk.security.SecurityCxfInterceptor" />
> >
> >
> > <cxf:bus>
> > <cxf:features>
> > <p:policies />
> > <cxf:logging />
> > </cxf:features>
> > <cxf:outInterceptors>
> > <ref bean="SecurityCxfInterceptor" />
> > </cxf:outInterceptors>
> > </cxf:bus>
> >
> >
> > And I've aslo tried to extend WSS4JOutInterceptor but it doesn't work,
> > as WSS4JOutInterceptor just add an EndingInterceptor which point to an
> > internal call that does the job.
> >
> >
> > Can somebody put me on the correct track to have my interceptor exectued
> > after WSS4JOutInterceptor so that I can update the username?
> >
> >
> >
> > Thanks,
> >
> > Thomas.
> >
>