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來拋出像這樣的鏈式異常?