【问题标题】:Spring Integration Log SOAP Message Content of int-ws:outbound-gatewayint-ws:outbound-gateway 的 Spring 集成日志 SOAP 消息内容
【发布时间】:2017-03-17 10:44:47
【问题描述】:

您能告诉我如何记录 int-ws:outbound-gateway 的 SOAP 消息发送/接收吗?

我试过了

<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 消息。

最好的问候,

【问题讨论】:

  • 我正在尝试 Marshaller.Listener 和 Unmarshaller.Listener。我认为这是可能的。
  • 它不起作用。它只能在 marshaller/unmarshaller 之前/之后捕获 java 对象,而不是 SOAP 消息:-(
  • 我认为您应该使用 PayloadLoggingInterceptor 。这里详细讲了。 stackoverflow.com/questions/32006048/…

标签: spring-integration spring-ws


【解决方案1】:

&lt;int-ws:outbound-gateway&gt;支持interceptor注入:

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

所以,你应该实现自己的LoggingClientInterceptor

您可以从现有的PayloadLoggingInterceptor 中借鉴日志记录的想法。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-02-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多