从传出拦截器中的会话中获取价值

时间:2018-08-01 08:54:14

标签: java web-services soap cxf interceptor

我想在致电之前将会话中的一些值添加到SOAPHeader

public class AddSOAPHeaderOutInterceptor extends AbstractSoapInterceptor {

  public AddSOAPHeaderOutInterceptor() {
    super(Phase.PRE_STREAM);
    this.addAfter(SoapOutInterceptor.class.getName());

  }

  @Override
  public void handleMessage(SoapMessage message) throws Fault {
    List<Header> listHeaders = message.getHeaders();

    HttpServletRequest servletRequest = (HttpServletRequest) message.get(AbstractHTTPDestination.HTTP_REQUEST); 
    //servletRequest is null after get from SoapMessage
  }

但是我遇到一个问题,当从HttpServletRequest中提取null实例是SoapMessage

我认为调用此拦截器时phase有问题。

有什么方法可以从这里获取session吗?

0 个答案:

没有答案