如何记录Spring jax-ws客户端的SOAP消息 [英] How to log the SOAP message of a spring jax-ws client

查看:66
本文介绍了如何记录Spring jax-ws客户端的SOAP消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用log4j记录由jax-ws客户端spring bean生成的SOAP消息.

I wanted to log with log4j the SOAP messages generated by a jax-ws client spring bean.

这是jax-ws客户端bean:

This is the jax-ws client bean:

<jaxws:client id="soapClient"  serviceClass="${serviceClass}" address="${service.url}"/>

推荐答案

只需按以下方式定义bean:

Just define the bean as follows:

<jaxws:client id="soapClient" 
    serviceClass="${serviceClass}"
    address="${serviceUrl}">
    <jaxws:outInterceptors>
        <ref bean="loggingOutInterceptor"/>
    </jaxws:outInterceptors>
</jaxws:client>
<bean id="loggingOutInterceptor" class="org.apache.cxf.interceptor.LoggingOutInterceptor" />

这篇关于如何记录Spring jax-ws客户端的SOAP消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆