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
CxfBeanDefinitionPostProcessor
for making beans from each PortType stub with @WebService
annotation@WebService
annotatoin. Configure BeanDefiniton
for this stub and pass control to next stage for build bean instance.CxfWsStubBeanFactory
. Factory bean match information about service endpoint by port type classname in spring.cxf
configuration. 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.WSInfo12PortType
By 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.skip
PortType 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();
}
@CxfGlobalInterceptor
will be applied to all found stubs.@CxfSpecificInterceptor
will be applied to stubs specified in applyFor
annotation member.