1 package com.freemindcafe.apache.cxf.wsdl.sample3;
3 import javax.servlet.http.HttpServletRequest;
5 import org.
apache.cxf.binding.soap.SoapMessage;
6 import org.
apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor;
19 public class SoapOutSecurityInterceptor
extends AbstractSoapInterceptor {
21 protected Logger logger = Logger.getLogger(SoapOutSecurityInterceptor.class);
23 public SoapOutSecurityInterceptor(){
24 super(Phase.PRE_PROTOCOL);
28 public void handleMessage(SoapMessage arg0)
throws Fault {
29 System.out.println(
"SoapOutSecurityInterceptor-----------------");
31 Message inMessage = arg0.getExchange().getInMessage();
34 if(inMessage != null) {
35 HttpServletRequest req = (HttpServletRequest) inMessage.get(
"HTTP.REQUEST");
37 if(req.getSession(
false) != null) {
38 logger.debug(
"invalidating the http session");
39 req.getSession().invalidate();
41 logger.warn(
" No session found Not able to invalidate http session");
47 logger.debug(
"Exiting current user");
51 logger.warn(
"http request is null Not able to invalidate http session");