WebService cxf 接口中获得拦截器参数

时间:2023-12-25 11:44:01

1.

拦截器中put属性

        Message message = PhaseInterceptorChain.getCurrentMessage();
message.put("AuthCode", esbRoute.getAuthCode());

2.

接口实现中获得MessageContext对象

    @Resource
 private WebServiceContext context; MessageContext ctx = context.getMessageContext();
String ac = (String) ctx.get("AuthCode");