Package de.codecentric.cxf.configuration
Class CxfAutoConfiguration
- java.lang.Object
-
- de.codecentric.cxf.configuration.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 ObjectWhile 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 Summary
Constructors Constructor Description CxfAutoConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringbaseAndServiceEndingUrl()StringbaseUrl()org.springframework.boot.web.servlet.ServletRegistrationBeancxfDispatcherServlet()We mostly want to autoinitialize the Endpoint and the CXFServlet.javax.xml.ws.Endpointendpoint()ObjectseiImplementation()StringserviceUrlEnding()voidsetUp()org.apache.cxf.bus.spring.SpringBusspringBus()WebServiceAutoDetectorwebServiceAutoDetector(org.springframework.context.ApplicationContext applicationContext)javax.xml.ws.ServicewebServiceClient()
-
-
-
Method Detail
-
webServiceAutoDetector
@Bean public WebServiceAutoDetector webServiceAutoDetector(org.springframework.context.ApplicationContext applicationContext) throws BootStarterCxfException
- Throws:
BootStarterCxfException
-
setUp
@PostConstruct public void setUp() throws BootStarterCxfException- Throws:
BootStarterCxfException
-
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()
-
seiImplementation
@Bean @ConditionalOnProperty(name="endpoint.autoinit", matchIfMissing=true) public Object seiImplementation() throws BootStarterCxfException- Throws:
BootStarterCxfException
-
endpoint
@Bean @ConditionalOnProperty(name="endpoint.autoinit", matchIfMissing=true) public javax.xml.ws.Endpoint endpoint() throws BootStarterCxfException- Throws:
BootStarterCxfException
-
webServiceClient
@Bean public javax.xml.ws.Service webServiceClient() throws BootStarterCxfException- Throws:
BootStarterCxfException
-
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">)
-
-