Search code examples
web-servicesspring-integrationgatewayoutbound

How to Log the message after request callback in web service outbound gateway


can you help me on how I can print the request message before completing the webservice call and after request-callback

<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" />

I have implemented doWithMessage, and would like to see what message is going.


Solution

  • This would be better done via ClientInterceptor. However there is already built-in feature in the Spring WS project for you: https://docs.spring.io/spring-ws/docs/3.0.1.RELEASE/reference/#logging

    Or borrow an idea from the PayloadLoggingInterceptor and implement similar logic in the ClientInterceptor.