I recently found an example on implementing a We3bService with groovy and jax-ws: the problem is that the @webmethod annotation seems to be ignored.
This is the source code of the groovy script:
import javax.jws.soap.*
import javax.jws.*
import javax.xml.ws.*
import javax.xml.bind.annotation.*
@XmlAccessorType(XmlAccessType.FIELD)
class Book {
String name
String author
}
@WebService (targetNamespace="http://predic8.com/groovy-jax/")
@SOAPBinding(parameterStyle=SOAPBinding.ParameterStyle.BARE)
class BookService{
@WebMethod
def add(Book book){
println "Name of the book: ${book.name}"
}
}
Endpoint.publish("http://localhost:9000/book", new BookService())
and this is the exception caught: Caught: com.sun.xml.internal.ws.model.RuntimeModelerException: runtime modeler error: SEI BookService has method setProperty annotated as BARE but it has more than one parameter bound to body. This is invalid. Please annotate the method with annotation: @SOAPBinding(parameterStyle=SOAPBinding.ParameterStyle.WRAPPED) at wstest.run(wstest.groovy:21)