views:

168

answers:

1

I am implementing SOAP web services for a commercial application, and I am using GroovyWS to speed up the development.

But, when I deploy it on Tomcat, I am not using Grails, as the software has it's own J2EE framework, so how I do I get it to react to wsdl requests?

Do I need to write a groovy-based servlet?

Ideally I would like the WSDL generated upon request, so I can easily change the interface and see the change.

It seems I will miss the annotations that JAX-WS provides for, though, to help fine-tune the WSDL.

+1  A: 

Using the example web application, the WSDL can be retrieved as follows:

http://localhost:6980/MathService?wsdl
Mark O'Connor
But if I am not using Grails, do I need to put something in web.xml in my webapps directory, for tomcat to redirect to MathService? Somehow Tomcat needs to know where to go.
James Black
You could add the standard *groovy.servlet.GroovyServlet* to your web.xml, so that the groovy script gets executed as a groovlet. The problem is that the class *groovyx.net.ws.WSServer* will startup another listener thread bound to another port on your server machine. Container within a container.....Perhaps you'd be better off trying to decorate your Groovy classes using the standard JAX-WS annotations?GroovyWS appears to be more useful as a client library than for server based programming
Mark O'Connor
Your comment is probably the correct answer. I wrote the service in Java, but I expect that decorating Groovy with annotations would have had the same effect.
James Black