首页 > 解决方案 > 如何在 Web 服务出站网关中的请求回调后记录消息

问题描述

你能帮我在完成网络服务调用之前和请求回调之后如何打印请求消息吗

<int:chain input-channel="tmsoapInChannel" output-channel="dest-channel">
<ws:header-enricher>
    <ws:soap-action value="http://bnst.l/tm/TWebService/vrrrectieRequest"/>
</ws:header-enricher>
<ws:outbound-gateway uri="http://bnst.l/tm/TWebService" request-callback="WSAHeaderCallback"/>
</int:chain>


  <int:logging-channel-adapter id="loggit" log-full-message="true" channel="justLog" />

我已经实现了 doWithMessage,并想看看消息是什么。

标签: web-servicesspring-integrationgatewayoutbound

解决方案


最好通过ClientInterceptor. 但是,Spring WS 项目中已经为您提供了内置功能:https ://docs.spring.io/spring-ws/docs/3.0.1.RELEASE/reference/#logging

或者从 中借用一个想法,在 中PayloadLoggingInterceptor实现类似的逻辑ClientInterceptor


推荐阅读