【发布时间】:2017-01-18 04:41:32
【问题描述】:
在 Spring Integration 中,使用 inbound-gateway,你知道如何将每个 SOAP WS 请求保存到单独的文件中吗?
目前,我坚持:
<!-- inbound -->
<ws:inbound-gateway id="inbound-gateway" request-channel="SOAPRequestChannel" reply-channel="SOAPResponseChannel"/>
<int:channel id="SOAPRequestChannel">
<int:interceptors>
<int:wire-tap channel="SOAPRequestChannelForLog"/>
</int:interceptors>
</int:channel>
<int:channel id="SOAPResponseChannel" />
<int:channel id="SOAPRequestChannelForLog" />
<int:logging-channel-adapter id="logger" expression="payload" level="INFO" channel="SOAPRequestChannelForLog"/>
但它只是将所有请求记录在 1 个文件中。
或者我必须编写另一个像 LogToFile 这样的类,它有一种方法可以将该请求保存到文件,将 int:logging-channel-adapter 替换为 int:service-activator ? Spring 是否支持开箱即用地记录每个 SOAP 请求?我阅读了参考文档,但找不到任何东西。
或者有更好的方法吗? ^_^
问候,
【问题讨论】:
-
我是通过阅读Spring Web Service 2 Cookbook一书发现Spring支持PayloadLoggingInterceptor & SoapEnvelopeLoggingInterceptor,然后查看参考文档。它在那里^_^
-
请正确回答问题并接受。这将帮助其他人找到解决方案,并且问题将从我的仪表板中消失。或者只是删除它:-)
-
嗨@Artem Bilan,实际上,这还不是解决方案,因为 PayloadLoggingInterceptor 使用 log4j2 记录有效负载。目前,我不知道如何配置 log4j2 来分别记录每个请求/响应。无论如何,我放了一个临时答案。
标签: web-services spring-integration inbound