【发布时间】:2009-10-24 03:36:12
【问题描述】:
我试图在一个方面访问 MessageContext(或 WebServiceContext)以访问 HTTPServletRequest 以进行日志记录。我想像为 spring-ws 一样注入上下文,但我还没有找到方法。这是我用于 spring-ws 的:
<beans:bean id="transportContext" class="org.springframework.ws.transport.context.TransportContextHolder" factory-method="getTransportContext" scope="request">
<aop:scoped-proxy/>
</beans:bean>
我不能在 WebServiceContext 字段/方法上使用 @Resource 注释,因为我不在服务中(无论如何都尝试过,但没有运气)。实例化 WebServiceContext(即 new WebServiceContextImpl())也不起作用,但应该应该因为这只是包装了一个 threadlocal。我也尝试过导入 cxf-extension-jaxws.xml 并使用 id org.apache.cxf.jaxws.context.WebServiceContextImpl 连接 bean,但没有成功(它不为 null,但没有任何内容)有什么想法吗?
谢谢
【问题讨论】: