You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "Nepali, Sonam (GE Healthcare, consultant)" <So...@ge.com> on 2010/02/10 23:50:10 UTC

Accessing soap message from Interceptors

Hi
 
I am trying to intercept the soap message in two separate interceptors:
one (InBoundInterceptor.java) for inbound soap message and another
(OutBoundInterceptor.java) for the outbound soap response from the
service.
 
I have been able to  intercept the soap message but only my
InBoundInterceptor.java is intercepting for both the inbound and the
outbound message from the service. 
 
Can anyone tell me what phase my inbound and outbound interceptor should
be in?
 
 
 I have my inbound and outbound interceptor defined as following:
 
 
 
public class InBoundInterceptor extends AbstractSoapInterceptor {
   private Logger logger =
LoggerFactory.getLogger(getClass().getName());
 
   public Interceptor1() {
      super(Phase.RECEIVE);
   }
 
  @Override
  public void handleMessage(SoapMessage soapMessage) {
   
   }
}
 
public class OutBoundInterceptor extends AbstractSoapInterceptor {
   private Logger logger =
LoggerFactory.getLogger(getClass().getName());
 
   public Interceptor1() {
      super(Phase.RECEIVE);
   }
 
  @Override
  public void handleMessage(SoapMessage soapMessage) {
   
   }
}
 
 
 
thanks

  
 
 
Sonam Nepali
sonam.nepali@ge.com
 

Re: Accessing soap message from Interceptors

Posted by Daniel Kulp <dk...@apache.org>.
Well, outbound wouldn't have a "RECEIVE" phase.  :-)

Depending on what you want to do, a SETUP phase or PREPARE_SEND or PRE_STREAM 
or similar.   

You can see the phases defined:
http://svn.apache.org/repos/asf/cxf/trunk/rt/core/src/main/java/org/apache/cxf/phase/PhaseManagerImpl.java

Dan

On Wed February 10 2010 5:50:10 pm Nepali, Sonam (GE Healthcare, consultant) 
wrote:
> Hi
> 
> I am trying to intercept the soap message in two separate interceptors:
> one (InBoundInterceptor.java) for inbound soap message and another
> (OutBoundInterceptor.java) for the outbound soap response from the
> service.
> 
> I have been able to  intercept the soap message but only my
> InBoundInterceptor.java is intercepting for both the inbound and the
> outbound message from the service.
> 
> Can anyone tell me what phase my inbound and outbound interceptor should
> be in?
> 
> 
>  I have my inbound and outbound interceptor defined as following:
> 
> 
> 
> public class InBoundInterceptor extends AbstractSoapInterceptor {
>    private Logger logger =
> LoggerFactory.getLogger(getClass().getName());
> 
>    public Interceptor1() {
>       super(Phase.RECEIVE);
>    }
> 
>   @Override
>   public void handleMessage(SoapMessage soapMessage) {
> 
>    }
> }
> 
> public class OutBoundInterceptor extends AbstractSoapInterceptor {
>    private Logger logger =
> LoggerFactory.getLogger(getClass().getName());
> 
>    public Interceptor1() {
>       super(Phase.RECEIVE);
>    }
> 
>   @Override
>   public void handleMessage(SoapMessage soapMessage) {
> 
>    }
> }
> 
> 
> 
> thanks
> 
> 
> 
> 
> Sonam Nepali
> sonam.nepali@ge.com

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog