Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integration of JAX-WS to Spring Boot

I have an existing API which has both JAX-RS and JAX-WS. I want to migrate it into a Spring Boot application. What I've done for JAX-RS part is registering that class:

@GET
@Path("/ping")
@Produces("text/plain")
String ping();

into a Jersey Config which extends ResourceConfig. Here is the example from JAX-WS of same class:

@WebMethod(operationName = "Ping", action = "ping-app")
String ping();

Since I've used reference implementations of JAX-RS and JAX-WS I hope that it should be easy to migrate it into Spring Boot. I've easily done JAX-RS integration. Is there any such simple way to integrate JAX-WS too?

like image 729
kamaci Avatar asked Oct 07 '16 18:10

kamaci


1 Answers

Ideally you'd want to use a Spring Boot Starter to assist you. According to their documentation:

Starters are a set of convenient dependency descriptors that you can include in your application. You get a one-stop-shop for all the Spring and related technology that you need, without having to hunt through sample code and copy paste loads of dependency descriptors. For example, if you want to get started using Spring and JPA for database access, just include the spring-boot-starter-data-jpa dependency in your project, and you are good to go.

Using this list of official and community starters, it looks like you have the following options:

  • spring-boot-starter-jersey should be able to handle JAX-RS
  • spring-boot-web-services might be able to handle JAX-WS. From what I understand, you might need to do things the 'Spring Web Services' way which is different to JAX-WS. It's been a while since I worked with Spring Web Services, so I might be incorrect on this point.
  • The Apache CXF starter can support both JAX-RS and JAX-WS which seems to meet your requirement. They have this guide for their spring boot integration for you to look at.
like image 152
Shiraaz.M Avatar answered Oct 01 '22 13:10

Shiraaz.M