// Path: spring-ws-log-http-headers/src/main/java/com/codenotfound/ws/interceptor/LogHttpHeaderClientInterceptor.java
// public class LogHttpHeaderClientInterceptor implements ClientInterceptor {
// 
//   @Override
//   public void afterCompletion(MessageContext arg0, Exception arg1)
//       throws WebServiceClientException {
//     // No-op
//   }
// 
//   @Override
//   public boolean handleFault(MessageContext messageContext) throws WebServiceClientException {
//     // No-op
//     return true;
//   }
// 
//   @Override
//   public boolean handleRequest(MessageContext messageContext) throws WebServiceClientException {
//     HttpLoggingUtils.logMessage("Client Request Message", messageContext.getRequest());
// 
//     return true;
//   }
// 
//   @Override
//   public boolean handleResponse(MessageContext messageContext) throws WebServiceClientException {
//     HttpLoggingUtils.logMessage("Client Response Message", messageContext.getResponse());
// 
//     return true;
//   }
// }


import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.oxm.jaxb.Jaxb2Marshaller;
import org.springframework.ws.client.core.WebServiceTemplate;
import org.springframework.ws.client.support.interceptor.ClientInterceptor;
import com.codenotfound.ws.interceptor.LogHttpHeaderClientInterceptor;
package com.codenotfound.ws.client;



@Configuration
public class ClientConfig {

  @Value("${client.default-uri}")
  private String defaultUri;

  @Bean
  Jaxb2Marshaller jaxb2Marshaller() {
    Jaxb2Marshaller jaxb2Marshaller = new Jaxb2Marshaller();
    jaxb2Marshaller.setContextPath("org.example.ticketagent");

    return jaxb2Marshaller;
  }

  @Bean
  public WebServiceTemplate webServiceTemplate() {
    WebServiceTemplate webServiceTemplate = new WebServiceTemplate();
    webServiceTemplate.setMarshaller(jaxb2Marshaller());
    webServiceTemplate.setUnmarshaller(jaxb2Marshaller());
    webServiceTemplate.setDefaultUri(defaultUri);

    // register the LogHttpHeaderClientInterceptor
    ClientInterceptor[] interceptors =
// Path: spring-ws-log-http-headers/src/main/java/com/codenotfound/ws/interceptor/LogHttpHeaderClientInterceptor.java
// public class LogHttpHeaderClientInterceptor implements ClientInterceptor {
// 
//   @Override
//   public void afterCompletion(MessageContext arg0, Exception arg1)
//       throws WebServiceClientException {
//     // No-op
//   }
// 
//   @Override
//   public boolean handleFault(MessageContext messageContext) throws WebServiceClientException {
//     // No-op
//     return true;
//   }
// 
//   @Override
//   public boolean handleRequest(MessageContext messageContext) throws WebServiceClientException {
//     HttpLoggingUtils.logMessage("Client Request Message", messageContext.getRequest());
// 
//     return true;
//   }
// 
//   @Override
//   public boolean handleResponse(MessageContext messageContext) throws WebServiceClientException {
//     HttpLoggingUtils.logMessage("Client Response Message", messageContext.getResponse());
// 
//     return true;
//   }
// }


// Path: spring-ws-log-http-headers/src/main/java/com/codenotfound/ws/client/ClientConfig.java
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.oxm.jaxb.Jaxb2Marshaller;
import org.springframework.ws.client.core.WebServiceTemplate;
import org.springframework.ws.client.support.interceptor.ClientInterceptor;
import com.codenotfound.ws.interceptor.LogHttpHeaderClientInterceptor;

package com.codenotfound.ws.client;



@Configuration
public class ClientConfig {

  @Value("${client.default-uri}")
  private String defaultUri;

  @Bean
  Jaxb2Marshaller jaxb2Marshaller() {
    Jaxb2Marshaller jaxb2Marshaller = new Jaxb2Marshaller();
    jaxb2Marshaller.setContextPath("org.example.ticketagent");

    return jaxb2Marshaller;
  }

  @Bean
  public WebServiceTemplate webServiceTemplate() {
    WebServiceTemplate webServiceTemplate = new WebServiceTemplate();
    webServiceTemplate.setMarshaller(jaxb2Marshaller());
    webServiceTemplate.setUnmarshaller(jaxb2Marshaller());
    webServiceTemplate.setDefaultUri(defaultUri);

    // register the LogHttpHeaderClientInterceptor
    ClientInterceptor[] interceptors =
        new ClientInterceptor[] {new LogHttpHeaderClientInterceptor()};