【问题标题】:Spring Integration Web Service Log SOAP Request Message (EVEN if the soap message is not correct)Spring Integration Web 服务日志 SOAP 请求消息(即使肥皂消息不正确)
【发布时间】:2017-03-09 11:18:55
【问题描述】:

你能告诉我如何记录 SOAP 消息,即使消息格式不正确?

<sws:interceptors>
    <bean class="com.capgemini.manulife.integration.interceptor.LogInterceptor" />
</sws:interceptors>

<!-- inbound -->
<ws:inbound-gateway id="cas-inbound-gateway" request-channel="casRequestChannel" reply-channel="casResponseChannel" 
        marshaller="casMarshaller"        unmarshaller="casMarshaller"  />
<int:channel id="casRequestChannel">
     <int:interceptors>
        <int:wire-tap channel="SOAPLogChannel"/>
    </int:interceptors>
</int:channel>
<int:channel id="SOAPLogChannel" /> 
<int:logging-channel-adapter id="logger" expression="payload" level="INFO" channel="SOAPLogChannel"/>

如你所见,我已经在使用 PayloadLoggingInterceptor(LogInterceptor 扩展 PayloadLoggingInterceptor),但它没有通过 PayloadLoggingInterceptor

谢谢你和最好的问候,

【问题讨论】:

    标签: spring web-services spring-integration


    【解决方案1】:

    这不是 Spring Integration 的问题,而是更多直接取决于 SOAP。

    因此,如果您的 XML 格式不正确,则您别无选择,除非在解组之前手动检查它。

    因此,您必须依靠simple &lt;ws:inbound-gateway&gt; 执行&lt;int-xml:validating-filter&gt;(或其他一些检查),然后才能执行&lt;int-xml:unmarshalling-transformer&gt;

    【讨论】:

    • 我尝试设置 Jaxb2Unmarshaller Unmarshaller Listener,以为它可以在解组之前记录消息,但监听器不是为此目的而设计的。
    • 我们可以使用Servlet过滤器来做吗?我认为这是可能的。试试看... :-)
    【解决方案2】:

    是的,我们可以使用 FilterRegistrationBean 将过滤器添加到 Spring Web Service ^^

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-09-16
      • 1970-01-01
      • 1970-01-01
      • 2017-11-24
      相关资源
      最近更新 更多