Skip to content

Instantly share code, notes, and snippets.

@jonashackt
Last active September 29, 2016 12:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonashackt/1897cad1248c442c8a0909a1aebfc1b8 to your computer and use it in GitHub Desktop.
Save jonashackt/1897cad1248c442c8a0909a1aebfc1b8 to your computer and use it in GitHub Desktop.
Configure SOAP-Message Logging in Apache CXF JaxWsProxyFactoryBean on Client Side
@Bean
public WeatherService weatherService() {
JaxWsProxyFactoryBean jaxWsFactory = new JaxWsProxyFactoryBean();
jaxWsFactory.setServiceClass(WeatherService.class);
jaxWsFactory.setAddress(buildUrl());
LoggingInInterceptor loggingInInterceptor = new LoggingInInterceptor();
loggingInInterceptor.setPrettyLogging(true);
LoggingOutInterceptor loggingOutInterceptor = new LoggingOutInterceptor();
loggingOutInterceptor.setPrettyLogging(true);
jaxWsFactory.getInInterceptors().add(loggingInInterceptor);
jaxWsFactory.getOutInterceptors().add(loggingOutInterceptor);
jaxWsFactory.getInFaultInterceptors().add(loggingInInterceptor);
jaxWsFactory.getOutFaultInterceptors().add(loggingOutInterceptor);
return (WeatherService) jaxWsFactory.create();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment