views:

957

answers:

1

Hi guys, I'm reimplementing a web app in Spring, and I need to expose the business logic with SOAP. I'm going for Spring 3.0, and I'd like to know: what is the recommended way of exposing Spring beans? The rest of my stack is Tomcat 6, JDK 1.6, Struts 2.

Cheers

Nik

+1  A: 

You can use Spring WS if you are using Spring 3. The Spring folks prefer contract first web services which is outlined in the tutorial.

Alternately, Jersey-WS is really good for REST based web services.

stevedbrown
I understand that REST APIs are included with Spring 3, so I'd rather use what comes with it. Will Spring WS be compatible with "the Spring 3 way"?
niklassaers
No, not exactly. Going over Spring 3 REST again, that looks pretty compelling too. It depends on if you want contract first or not - I never would - if not, use the Spring 3 REST implementation if it's working properly (it's not released yet as far as I know).
stevedbrown
We use the REST stuff in Spring 3 Milestone 3, and it works perfectly. Much nicer than JAX-RS. Oh, and +1 for Spring-WS - this is the way that SOAP should be done, and it integrates perfectly with the Spring 2.5-style annotated controller pattern.
skaffman
I'll build my REST interface from the ground up, but my SOAP interface needs to conform to an already defined WSDL since I'm rebuilding a SOAP interface to work with my Spring logic rather than the deprecated .Net project it precedes. So I'm contract first when it comes to the SOAP interface. So what I hear you say is: (1) Use Spring 3 for REST, (2) Use Spring WS with Spring 3 for SOAP. Correct?
niklassaers
I think skaffman should post a Spring 3 REST answer here and I should build something concrete with it.
stevedbrown
@niklassaers: yes, that would be my recommendation.
skaffman