I think I’m just missing something simple here but here is what I am working from…
@WebService
public interface MyService {
public AnInterface doStuff();
}
Here is some of what I have tried. All with CXF 2.5.2 + Spring on Weblogic 10.3.4…
- Use @XmlSeeAlso on the MyService interface and AnInterface to point JAXB to the
AnInterfaceImplclass. This still resulted in the infamous JAXB can’t handle interfaces exception. - Used @XmlElementReference on the method but this had the same effect as item (1) and seems to be for property serialization
- Use @ResponseWrapper on the method but it’s my understanding that CXF does this automatically (Bare vs Wrapped) but I may be wrong. While this allowed WSDL to be created marshaling at runtime always returned a default object. Perhaps I misunderstand how this annotation should work.
I’m guessing there is some way to easily annotate that AnInterface should be exposed via
AnInterfaceImpl from the MyService class pretty easily but I’m missing some crucial and simple step.
The trick appears to be the use of
@XmlJavaTypeAdapteron the target interfaces as described here. It is not obvious to me why this works where other methods seem to fail.