如何记录spring jax-ws客户端的SOAP消息

时间:2014-03-12 14:28:38

标签: spring soap jax-ws

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

这是jax-ws客户端bean:

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

1 个答案:

答案 0 :(得分:1)

只需按如下方式定义bean:

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