2

I need to use an interface as a parameter and as a return type in a JAX-WS web method. When starting my server I receive an IllegalAnnotationsException, which tells me that JAXB cannot handle interfaces.

I tried to annotate my class, method result and method parameters with @XmlRootElement and @XmlElement(type = ...) respectively, but this does not work.

How can I use an interface as an parameter and as a result type in a JAX-WS web method?

Manuel Faux
  • 2,317
  • 5
  • 24
  • 35

1 Answers1

2

Take a look at @XmlJavaTypeAdapter. Maybe it will do the trick. More information available in here.

Paulius Matulionis
  • 23,085
  • 22
  • 103
  • 143