1
我有类似这样的代码:您可以使用JAX-WS和SOAP抛出链式异常吗?
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()
返回null。
有没有办法使用JAX-WS & SOAP来抛出像这样的链式异常?