J'ai récemment trouvé un exemple sur l'implémentation d'un We3bService avec groovy et jax-ws: le problème est que l'annotation @webmethod semble être ignorée.Groovy & Jax-ws: Annotation @WebMethod ignorée
C'est le code source du script groovy:
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())
et c'est l'exception pris: Pris: com.sun.xml.internal.ws.model.RuntimeModelerException: Erreur d'exécution de modeleur: SEI BookService a la méthode setProperty annoté comme BARE mais il a plus d'un paramètre lié au corps. Ceci est invalide. S'il vous plaît annoter la méthode avec l'annotation: @SOAPBinding (ParameterStyle = SOAPBinding.ParameterStyle.WRAPPED) à wstest.run (wstest.groovy: 21)
Je sais que c'était il y a longtemps, mais avez-vous réellement résolu ce problème, je reçois la même erreur, mais je ne sais pas quoi faire à ce sujet? – ssayyed