Exceptions to method declarations. Jaxb

Suppose I have an exception hierarchy like this:

public class A extends RuntimeException {
...
}

public class B extends A {
...
}

There is a method in the web service interface:

public void aa() throws A;

An implementation of this method can throw either an exception Aor an exception B, but when deployed to tomcat cxf, wsdl is published only with an exception declaration A.

I tried to use @XmlRootElementfor both classes, @XmlTypefor both classes, @XmlRootElementfor the parent class, @XmlRootElementwith @XmlSeeAlsofor the parent class, but the published wsdl has no Bexception. In addition, I wrote a test that uses this wsdl, and the test only gets an exception, but I emulated both types of exceptions. How can I get child exception in wsdl declaration?

+3
1

, A, B aa, jaxb , . :

public void aa() throws A, B;
+2

All Articles