// Path: step3_jaxws-endpoint-cxf-spring-boot/src/main/java/de/jonashackt/tutorial/endpoint/WeatherServiceEndpoint.java
// public class WeatherServiceEndpoint implements WeatherService {
// 
//     @Override
//     public ForecastReturn getCityForecastByZIP(ForecastRequest forecastRequest)
//             throws WeatherException {
//         // TODO Auto-generated method stub
//         return null;
//     }
//     
//     @Override
//     public WeatherInformationReturn getWeatherInformation(String zip)
//             throws WeatherException {
//         // TODO Auto-generated method stub
//         return null;
//     }
// 
//     @Override
//     public WeatherReturn getCityWeatherByZIP(ForecastRequest forecastRequest)
//             throws WeatherException {
//         // TODO Auto-generated method stub
//         return null;
//     }
// 
// }
// 
// Path: step10_simple_app_with_cxf-spring-boot-starter/src/main/java/de/jonashackt/tutorial/xmlvalidation/WeatherFaultBuilder.java
// @Component
// public class WeatherFaultBuilder implements CustomFaultBuilder {
// 
// 	private de.codecentric.namespace.weatherservice.exception.ObjectFactory objectFactoryDatatypes = new de.codecentric.namespace.weatherservice.exception.ObjectFactory();
// 
// 	@Override
// 	public String createCustomFaultMessage(FaultType faultType) {
// 		if(FaultType.SCHEME_VALIDATION_ERROR.equals(faultType)) {
// 			return CustomIds.NON_XML_COMPLIANT.getMessage();
// 		}
// 		else if(FaultType.SYNTACTICALLY_INCORRECT_XML_ERROR.equals(faultType)) {
// 			return CustomIds.COMPLETE_USELESS_XML.getMessage();
// 		}
// 		else {
// 			return CustomIds.SOMETHING_ELSE_WENT_TERRIBLY_WRONG.getMessage();
// 		}
// 	}
// 
// 	@Override
// 	public WeatherException createCustomFaultDetail(String originalFaultMessage, FaultType faultType) {
// 		// Build SOAP-Fault detail <datatypes:WeatherException>
// 		WeatherException weatherException = objectFactoryDatatypes.createWeatherException();
// 		weatherException.setBigBusinessErrorCausingMoneyLoss(true);
// 		setIdBasedUponFaultContent(faultType, weatherException);
// 		weatherException.setExceptionDetails(originalFaultMessage);
// 		weatherException.setUuid("ExtremeRandomNumber");
// 		return weatherException;
// 	}
// 
// 	private void setIdBasedUponFaultContent(FaultType faultType, WeatherException weatherException) {
// 		if(FaultType.SCHEME_VALIDATION_ERROR.equals(faultType)) {
// 			weatherException.setBusinessErrorId(CustomIds.NON_XML_COMPLIANT.getId());
// 		}
// 		else if(FaultType.SYNTACTICALLY_INCORRECT_XML_ERROR.equals(faultType)) {
// 			weatherException.setBusinessErrorId(CustomIds.COMPLETE_USELESS_XML.getId());
// 		}
// 		else {
// 			weatherException.setBusinessErrorId(CustomIds.SOMETHING_ELSE_WENT_TERRIBLY_WRONG.getId());
// 		}
// 	}
// }


import de.codecentric.cxf.xmlvalidation.CustomFaultBuilder;
import de.codecentric.namespace.weatherservice.Weather;
import de.codecentric.namespace.weatherservice.WeatherService;
import de.jonashackt.tutorial.endpoint.WeatherServiceEndpoint;
import de.jonashackt.tutorial.xmlvalidation.WeatherFaultBuilder;
import org.apache.cxf.bus.spring.SpringBus;
import org.apache.cxf.jaxws.EndpointImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.xml.ws.Endpoint;
package de.jonashackt.tutorial.configuration;



@Configuration
public class SimpleBootCxfConfiguration {

    public static final String SERVICE_URL = "/WeatherSoapService_1.0";

    @Autowired
    private SpringBus springBus;

    @Bean
    public WeatherService weatherService() {
        return new WeatherServiceEndpoint();
    }

    @Bean
    public Endpoint endpoint() {
        EndpointImpl endpoint = new EndpointImpl(springBus, weatherService());
        endpoint.setServiceName(weatherClient().getServiceName());
        endpoint.setWsdlLocation(weatherClient().getWSDLDocumentLocation().toString());
        endpoint.publish(SERVICE_URL);
        return endpoint;
    }

    @Bean
    public Weather weatherClient() {
        return new Weather();
    }

    @Bean
    public CustomFaultBuilder weatherFaultBuilder() {
// Path: step3_jaxws-endpoint-cxf-spring-boot/src/main/java/de/jonashackt/tutorial/endpoint/WeatherServiceEndpoint.java
// public class WeatherServiceEndpoint implements WeatherService {
// 
//     @Override
//     public ForecastReturn getCityForecastByZIP(ForecastRequest forecastRequest)
//             throws WeatherException {
//         // TODO Auto-generated method stub
//         return null;
//     }
//     
//     @Override
//     public WeatherInformationReturn getWeatherInformation(String zip)
//             throws WeatherException {
//         // TODO Auto-generated method stub
//         return null;
//     }
// 
//     @Override
//     public WeatherReturn getCityWeatherByZIP(ForecastRequest forecastRequest)
//             throws WeatherException {
//         // TODO Auto-generated method stub
//         return null;
//     }
// 
// }
// 
// Path: step10_simple_app_with_cxf-spring-boot-starter/src/main/java/de/jonashackt/tutorial/xmlvalidation/WeatherFaultBuilder.java
// @Component
// public class WeatherFaultBuilder implements CustomFaultBuilder {
// 
// 	private de.codecentric.namespace.weatherservice.exception.ObjectFactory objectFactoryDatatypes = new de.codecentric.namespace.weatherservice.exception.ObjectFactory();
// 
// 	@Override
// 	public String createCustomFaultMessage(FaultType faultType) {
// 		if(FaultType.SCHEME_VALIDATION_ERROR.equals(faultType)) {
// 			return CustomIds.NON_XML_COMPLIANT.getMessage();
// 		}
// 		else if(FaultType.SYNTACTICALLY_INCORRECT_XML_ERROR.equals(faultType)) {
// 			return CustomIds.COMPLETE_USELESS_XML.getMessage();
// 		}
// 		else {
// 			return CustomIds.SOMETHING_ELSE_WENT_TERRIBLY_WRONG.getMessage();
// 		}
// 	}
// 
// 	@Override
// 	public WeatherException createCustomFaultDetail(String originalFaultMessage, FaultType faultType) {
// 		// Build SOAP-Fault detail <datatypes:WeatherException>
// 		WeatherException weatherException = objectFactoryDatatypes.createWeatherException();
// 		weatherException.setBigBusinessErrorCausingMoneyLoss(true);
// 		setIdBasedUponFaultContent(faultType, weatherException);
// 		weatherException.setExceptionDetails(originalFaultMessage);
// 		weatherException.setUuid("ExtremeRandomNumber");
// 		return weatherException;
// 	}
// 
// 	private void setIdBasedUponFaultContent(FaultType faultType, WeatherException weatherException) {
// 		if(FaultType.SCHEME_VALIDATION_ERROR.equals(faultType)) {
// 			weatherException.setBusinessErrorId(CustomIds.NON_XML_COMPLIANT.getId());
// 		}
// 		else if(FaultType.SYNTACTICALLY_INCORRECT_XML_ERROR.equals(faultType)) {
// 			weatherException.setBusinessErrorId(CustomIds.COMPLETE_USELESS_XML.getId());
// 		}
// 		else {
// 			weatherException.setBusinessErrorId(CustomIds.SOMETHING_ELSE_WENT_TERRIBLY_WRONG.getId());
// 		}
// 	}
// }


// Path: step10_simple_app_with_cxf-spring-boot-starter/src/main/java/de/jonashackt/tutorial/configuration/SimpleBootCxfConfiguration.java
import de.codecentric.cxf.xmlvalidation.CustomFaultBuilder;
import de.codecentric.namespace.weatherservice.Weather;
import de.codecentric.namespace.weatherservice.WeatherService;
import de.jonashackt.tutorial.endpoint.WeatherServiceEndpoint;
import de.jonashackt.tutorial.xmlvalidation.WeatherFaultBuilder;
import org.apache.cxf.bus.spring.SpringBus;
import org.apache.cxf.jaxws.EndpointImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.xml.ws.Endpoint;

package de.jonashackt.tutorial.configuration;



@Configuration
public class SimpleBootCxfConfiguration {

    public static final String SERVICE_URL = "/WeatherSoapService_1.0";

    @Autowired
    private SpringBus springBus;

    @Bean
    public WeatherService weatherService() {
        return new WeatherServiceEndpoint();
    }

    @Bean
    public Endpoint endpoint() {
        EndpointImpl endpoint = new EndpointImpl(springBus, weatherService());
        endpoint.setServiceName(weatherClient().getServiceName());
        endpoint.setWsdlLocation(weatherClient().getWSDLDocumentLocation().toString());
        endpoint.publish(SERVICE_URL);
        return endpoint;
    }

    @Bean
    public Weather weatherClient() {
        return new Weather();
    }

    @Bean
    public CustomFaultBuilder weatherFaultBuilder() {
        return new WeatherFaultBuilder();