Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.

Commit

Permalink
Activate SoapMessageLogging in client mode also
Browse files Browse the repository at this point in the history
  • Loading branch information
jonashackt committed Apr 15, 2019
1 parent abb3423 commit 2bf01b8
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package de.codecentric.soap.configuration;

import de.codecentric.cxf.logging.soapmsg.SoapMessageLoggingInInterceptor;
import de.codecentric.cxf.logging.soapmsg.SoapMessageLoggingOutInterceptor;
import org.apache.cxf.interceptor.AbstractLoggingInterceptor;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
Expand Down Expand Up @@ -37,8 +40,26 @@ public WeatherService weatherServiceClient() {
JaxWsProxyFactoryBean jaxWsFactory = new JaxWsProxyFactoryBean();
jaxWsFactory.setServiceClass(WeatherService.class);
jaxWsFactory.setAddress(buildUrl());
jaxWsFactory.getInInterceptors().add(logInInterceptorClientSoapMsgLogger());
jaxWsFactory.getOutInterceptors().add(logOutInterceptorClientSoapMsgLogger());
return (WeatherService) jaxWsFactory.create();
}

@Bean
public AbstractLoggingInterceptor logInInterceptorClientSoapMsgLogger() {
SoapMessageLoggingInInterceptor logInInterceptor = new SoapMessageLoggingInInterceptor();
logInInterceptor.logSoapMessage(true);
logInInterceptor.setPrettyLogging(true);
return logInInterceptor;
}

@Bean
public AbstractLoggingInterceptor logOutInterceptorClientSoapMsgLogger() {
SoapMessageLoggingOutInterceptor logOutInterceptor = new SoapMessageLoggingOutInterceptor();
logOutInterceptor.logSoapMessage(true);
logOutInterceptor.setPrettyLogging(true);
return logOutInterceptor;
}

/*
* SoapRawClient for XmlErrorTests
Expand Down

0 comments on commit 2bf01b8

Please sign in to comment.