【问题标题】:Apache CXF headers needed inside soap web serviceSOAP Web 服务中需要 Apache CXF 标头
【发布时间】:2014-08-14 23:06:29
【问题描述】:

我们有一个 apache cxf 网络服务。我写了一个 inInterceptor,它将标头记录到控制台。
我们的 Web 服务有 service、serviceImpl ......dao 等层
我们发现,我们想要在 DAO 中提供一个标头(对于每个请求都是唯一的)。
有什么方法可以实现吗?

【问题讨论】:

    标签: web-services cxf


    【解决方案1】:

    您可以使用PhaseInterceptorChain.getCurrentMessage() 检索当前的CXF Message。收到消息后,您可以像在拦截器中一样检索标头。例如:

    Message message = PhaseInterceptorChain.getCurrentMessage();
    Map<String, List<String>> headers = (Map<String, List<String>>) message
                    .get(Message.PROTOCOL_HEADERS);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-08-13
      • 2012-04-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多