The best way to consumer your legacy jax-ws services.
Versions compatibility:
3.x.x – Spring Boot 2.x.x 1.x.x – Is too old, not supported
Add as dependency
dependencies {
compile 'ru.alfalab.starter.cxf:starter:{starterVersion}'
}Enable or disable by spring.cxf.client.enabled bool option
- Cxf starter configure new
CxfBeanDefinitionPostProcessorfor making beans from each PortType stub with@WebServiceannotation - Automatically scan classpath and find all classes with
@WebServiceannotatoin. ConfigureBeanDefinitonfor this stub and pass control to next stage for build bean instance. - Each bean has constructed by factory bean -
CxfWsStubBeanFactory. Factory bean match information about service endpoint by port type classname inspring.cxfconfiguration. See example below.
spring.cxf:
clients:
-
endpoint: http://ws.srv/TESTSERVICE/TESTSERVICE12
className: ru.testservice.TestService12PortType
-
endpoint: http://ws.srv/TEST/INFO/WSInfo12/WSInfo12PortType
className: ru.test.info.WSInfo12PortTypeBy default all services searching in ru. package. If you need change it you have to add next properties into your application.yml.
Also you can specify packages you don't want to scan.
For example:
spring.cxf:
packages:
scan:
- myorg.package
skip:
- myorg.package.skipPortType stubs can be provided with a list of interceptors. If you want to use this feature, you have to declare your interceptor as Spring Bean in your code
and annotate it with @CxfSpecificInterceptor or @CxfGlobalInterceptor.
There are 4 types of interceptors: IN, IN_FAULT, OUT and OUT_FAULT.
For example:
@Bean
@CxfGlobalInterceptor(type = InterceptorType.OUT) (1)
my.awesome.in.Interceptor myAwesomeInInterceptor() {
return new my.awesome.in.Interceptor();
}or
@Bean
@CxfSpecificInterceptor(type = InterceptorType.IN, applyFor = { WSInfo12PortType.class, CorruptedWSInfo12PortType.class }) (2)
public WSS4JInInterceptor specificInterceptor() {
return new WSS4JInInterceptor();
}- Interceptor beans annotated with
@CxfGlobalInterceptorwill be applied to all found stubs. - Interceptor beans annotated with
@CxfSpecificInterceptorwill be applied to stubs specified inapplyForannotation member.
- Kirill Tolkachev @tolkv
- Maxim Gorelikov @gorelikoff
- Maxim Konshin
- Maxim Shatunov
- Lev Nikeshkin
- Shmakov Nikita
- Yulia Karavaeva
- Anton Fedosov