// Path: step4_test/src/main/java/de/jonashackt/tutorial/configuration/WebServiceConfiguration.java
// @Configuration
// public class WebServiceConfiguration {
// 	
//     public static final String BASE_URL = "/soap-api";
//     public static final String SERVICE_URL = "/WeatherSoapService_1.0";
//     
//     @Bean
//     public ServletRegistrationBean cxfServlet() {
//         return new ServletRegistrationBean(new CXFServlet(), BASE_URL + "/*");
//     }
// 
//     @Bean(name = Bus.DEFAULT_BUS_ID)
//     public SpringBus springBus() {
//         return new SpringBus();
//     }    
//     
//     @Bean
//     public WeatherService weatherService() {
//     	return new WeatherServiceEndpoint();
//     }
//     
//     @Bean
//     public Endpoint endpoint() {
//         EndpointImpl endpoint = new EndpointImpl(springBus(), weatherService());        
//         // CXF JAX-WS implementation relies on the correct ServiceName as QName-Object with
//         // the name-Attribute´s text <wsdl:service name="Weather"> and the targetNamespace
//         // "http://www.codecentric.de/namespace/weatherservice/"
//         // Also the WSDLLocation must be set
//         endpoint.setServiceName(weather().getServiceName());
//         endpoint.setWsdlLocation(weather().getWSDLDocumentLocation().toString());
//         endpoint.publish(SERVICE_URL);
//         return endpoint;
//     }
//     
//     @Bean
//     public Weather weather() {
//         // Needed for correct ServiceName & WSDLLocation to publish contract first incl. original WSDL
//         return new Weather();
//     }
// }


import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import de.codecentric.namespace.weatherservice.WeatherService;
import de.jonashackt.tutorial.configuration.WebServiceConfiguration;
package de.jonashackt.tutorial;



@Configuration
public class WebServiceSystemTestConfiguration {
    
    @Bean
    public WeatherService weatherServiceSystemTestClient() {
        JaxWsProxyFactoryBean jaxWsProxyFactory = new JaxWsProxyFactoryBean();
        jaxWsProxyFactory.setServiceClass(WeatherService.class);
// Path: step4_test/src/main/java/de/jonashackt/tutorial/configuration/WebServiceConfiguration.java
// @Configuration
// public class WebServiceConfiguration {
// 	
//     public static final String BASE_URL = "/soap-api";
//     public static final String SERVICE_URL = "/WeatherSoapService_1.0";
//     
//     @Bean
//     public ServletRegistrationBean cxfServlet() {
//         return new ServletRegistrationBean(new CXFServlet(), BASE_URL + "/*");
//     }
// 
//     @Bean(name = Bus.DEFAULT_BUS_ID)
//     public SpringBus springBus() {
//         return new SpringBus();
//     }    
//     
//     @Bean
//     public WeatherService weatherService() {
//     	return new WeatherServiceEndpoint();
//     }
//     
//     @Bean
//     public Endpoint endpoint() {
//         EndpointImpl endpoint = new EndpointImpl(springBus(), weatherService());        
//         // CXF JAX-WS implementation relies on the correct ServiceName as QName-Object with
//         // the name-Attribute´s text <wsdl:service name="Weather"> and the targetNamespace
//         // "http://www.codecentric.de/namespace/weatherservice/"
//         // Also the WSDLLocation must be set
//         endpoint.setServiceName(weather().getServiceName());
//         endpoint.setWsdlLocation(weather().getWSDLDocumentLocation().toString());
//         endpoint.publish(SERVICE_URL);
//         return endpoint;
//     }
//     
//     @Bean
//     public Weather weather() {
//         // Needed for correct ServiceName & WSDLLocation to publish contract first incl. original WSDL
//         return new Weather();
//     }
// }


// Path: step9_soap_message_logging_into_custom_elasticsearch_field/src/test/java/de/jonashackt/tutorial/WebServiceSystemTestConfiguration.java
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import de.codecentric.namespace.weatherservice.WeatherService;
import de.jonashackt.tutorial.configuration.WebServiceConfiguration;

package de.jonashackt.tutorial;



@Configuration
public class WebServiceSystemTestConfiguration {
    
    @Bean
    public WeatherService weatherServiceSystemTestClient() {
        JaxWsProxyFactoryBean jaxWsProxyFactory = new JaxWsProxyFactoryBean();
        jaxWsProxyFactory.setServiceClass(WeatherService.class);
        jaxWsProxyFactory.setAddress("http://localhost:8090" + WebServiceConfiguration.BASE_URL + WebServiceConfiguration.SERVICE_URL);