Spring int-ws:outbound-gateway 的集成日志 SOAP 消息内容

Spring Integration Log SOAP Message Content of int-ws:outbound-gateway

你能告诉我如何记录 int-ws:outbound-gateway 的 SOAP 消息 send/received 吗?

我试过了

<int-ws:outbound-gateway id="ais-outbound-gateway"
    request-channel="aisRequestChannel" reply-channel="aisResponseChannel"
    uri="http://localhost:8080/services/ONESHOT" 
    marshaller="aisMarshaller"        unmarshaller="aisMarshaller" /> 

<int:channel id="aisRequestChannel">
    <int:interceptors>
        <int:wire-tap channel="logChannel"/>
    </int:interceptors>
</int:channel>   
<int:channel id="aisResponseChannel">
    <int:interceptors>
        <int:wire-tap channel="logChannel"/>
    </int:interceptors>
</int:channel>

<int:logging-channel-adapter expression="payload" id="logChannel" level="DEBUG"  />

但负载只是 java 对象,而不是 SOAP 消息。

此致,

<int-ws:outbound-gateway>支持interceptor注入:

<xsd:documentation>
    Reference to the bean definition of a ClientInterceptor.
</xsd:documentation>

因此,您应该实现自己的 LoggingClientInterceptor

您可以从现有 PayloadLoggingInterceptor.

中借鉴的日志记录思路