2

I have been contemplating on building a test jar for a community of developers in order to expose a preview of a next release of an API (having stubs returning expected response with exact format etc). We do have both REST and SOAP API. I guess it won't be any problem building the REST Service as the net is flooded with example. It was quite surprising there isn't much of concrete example of how to build SOAP service (JAXWS) with spring boot with embedded jetty.

What I expect to achieve is one single jar with both APIs. I am rather comfortable developing a java first services. I have seen a post in stackoverflow but it doesn't clearly outline steps to achieve that. I know it's possible because dropwizard guys have similar project.

I will be grateful if there is any resource with example on how to handle SOAP web services in spring boot.

Thanks you in advance

Community
  • 1
  • 1
black sensei
  • 6,528
  • 22
  • 109
  • 188

1 Answers1

2

Spring already supports JAXWS through *JaxWsServiceExporter and SpringBeanAutowiringSupport (in spring-web). The *Exporter approach doesn't quite mesh with the REST stuff because it isn't in the embedded container. You'd end up with an app listening on 2 ports (one for XML and one for JSON). If either of those works then you have a solution. If you don't really care that much about SOAP and just want XML representations, you can use normal content negotiation features (e.g. @ResponseBody or @RestController for everything).

Dave Syer
  • 56,583
  • 10
  • 155
  • 143
  • Hi thanks for the solution, I do not mind at all having separate port. it's meant for developers to get acquainted with an upcoming API. Do you have a specific example of using SOAP in spring boot context? – black sensei Mar 14 '14 at 14:05
  • I don't, but it's just a Spring feature and it's pretty lightweight. Google turned up this pretty quickly: http://www.javacodegeeks.com/2010/11/jaxws-with-spring-and-maven-tutorial.html. I'm sure you can find more. BTW, you don't end up with a separate port if you use the `SpringBeanAutowiringSupport` (only the exporters). – Dave Syer Mar 14 '14 at 14:57
  • Thanks for the information,I just happen to stumble upon the same link :) – black sensei Mar 14 '14 at 16:17