我有一些类似的代码:
public class SOAPServer {
public Object[] getObjects() throws IllegalStateException {
Object[] objects = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" }
int index = 10;
try {
Object object = objects[index];
} catch (Exception e) {
throw new IllegalStateException("Server cannot access Object " + index + ".", e);
}
return objects;
}
}
客户端可以毫无问题地接收抛出的异常,但似乎原因没有通过 SOAP 传递。Exception::getCause()
返回空值。
有没有办法使用 JAX-WS 和 SOAP 来抛出这样的链式异常?