Giter Club home page Giter Club logo

cxf-ws-client-spring-boot-starter's Introduction

Spring Boot Apache CXF WS-Clients starter

Codacy Badge Coverage Status Build Status Download

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

Quick start

Add as dependency

    dependencies {
        compile 'ru.alfalab.starter.cxf:starter:{starterVersion}'
    }

Enable or disable by spring.cxf.client.enabled bool option

How it works

  1. Cxf starter configure new CxfBeanDefinitionPostProcessor for making beans from each PortType stub with @WebService annotation
  2. Automatically scan classpath and find all classes with @WebService annotatoin. Configure BeanDefiniton for this stub and pass control to next stage for build bean instance.
  3. Each bean has constructed by factory bean - 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

Interceptors

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();
}
  1. Interceptor beans annotated with @CxfGlobalInterceptor will be applied to all found stubs.
  2. Interceptor beans annotated with @CxfSpecificInterceptor will be applied to stubs specified in applyFor annotation member.

Special thanks and authors

  • Kirill Tolkachev @tolkv
  • Maxim Gorelikov @gorelikoff
  • Maxim Konshin
  • Maxim Shatunov
  • Lev Nikeshkin
  • Shmakov Nikita
  • Yulia Karavaeva
  • Anton Fedosov

cxf-ws-client-spring-boot-starter's People

Contributors

codacy-badger avatar lavcraft avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cxf-ws-client-spring-boot-starter's Issues

License

Может стоит добавить файл с лицензией?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.