Class CxfAutoConfiguration


  • @Configuration
    @ConditionalOnClass(org.apache.cxf.transport.servlet.CXFServlet.class)
    @PropertySource("classpath:spring-boot-starter-cxf.properties")
    @Import({XmlValidationConfiguration.class,SoapMessageLoggerConfiguration.class,TimeLoggingConfiguration.class})
    public class CxfAutoConfiguration
    extends Object
    While booting up the CXF-Framework and Servlets, we don´t override the Bean "dispatcherServlet" here - because, if you want to use a second Servlet (e.g. because you need some REST-Endpoint via the @RestController Annotation), you just could use it. Otherwise, those Servlets would override themselfs.
    Author:
    jonashecht
    • Constructor Detail

      • CxfAutoConfiguration

        public CxfAutoConfiguration()
    • Method Detail

      • cxfDispatcherServlet

        @Bean
        @ConditionalOnProperty(name="endpoint.autoinit",
                               matchIfMissing=true)
        public org.springframework.boot.web.servlet.ServletRegistrationBean cxfDispatcherServlet()
        We mostly want to autoinitialize the Endpoint and the CXFServlet. But when in client mode, this isn´t always wanted (e.g. when you are in Client only mode and just want to test or call some SOAP services, but not provide services on your own.

        Because there is (& sadly will be) no @ConditionalOnMissingProperty in Spring Boot (https://github.com/spring-projects/spring-boot/issues/4938), we need to use a workaround:

        If endpoint.autoinit is NOT set, Endpoint autoinitialization will run. If endpoint.autoinit is set to some other value than false, autoinitialization will also run.

        Only if endpoint.autoinit = false, the autoinitialization isn´t running.
      • springBus

        @Bean(name="cxf")
        @ConditionalOnProperty(name="endpoint.autoinit",
                               matchIfMissing=true)
        public org.apache.cxf.bus.spring.SpringBus springBus()
      • baseUrl

        public String baseUrl()
        Returns:
        the base-URL, where the WebServices are configured (eihter via property or default-value)
      • serviceUrlEnding

        public String serviceUrlEnding()
        Returns:
        the concrete Service URL-ending, where the WebService is configured according to your WSDL´s Service Name (e.g. "/Weather" when there is this inside your WSDL: <wsdl:service name="Weather">)
      • baseAndServiceEndingUrl

        public String baseAndServiceEndingUrl()
        Returns:
        the base-URL, where the WebServices are configured (eihter via property or default-value) and appended the concrete Service URL-ending, where the WebService is configured according to your WSDL´s Service Name (e.g. "/Weather" when there is this inside your WSDL: <wsdl:service name="Weather">)