Author: alessio.soldano(a)jboss.com
Date: 2013-07-12 06:36:58 -0400 (Fri, 12 Jul 2013)
New Revision: 17770
Modified:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/invocation/AbstractInvocationHandler.java
Log:
[JBWS-3601] Porting WFLY-1667 fix to AS 7.2 ASIL
Modified:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/invocation/AbstractInvocationHandler.java
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/invocation/AbstractInvocationHandler.java 2013-07-12
07:18:34 UTC (rev 17769)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/invocation/AbstractInvocationHandler.java 2013-07-12
10:36:58 UTC (rev 17770)
@@ -31,6 +31,7 @@
import java.util.Collection;
import javax.management.MBeanException;
+import javax.xml.ws.soap.SOAPFaultException;
import org.jboss.as.ee.component.Component;
import org.jboss.as.ee.component.ComponentView;
@@ -149,6 +150,11 @@
if (t instanceof InvocationTargetException) {
throw (Exception) t;
} else {
+ SOAPFaultException ex = findSoapFaultException(t);
+ if (ex != null)
+ {
+ throw new InvocationTargetException(ex);
+ }
throw new InvocationTargetException(t);
}
}
@@ -157,6 +163,19 @@
}
throw new UndeclaredThrowableException(t);
}
+
+ protected SOAPFaultException findSoapFaultException(Throwable ex)
+ {
+ if (ex instanceof SOAPFaultException)
+ {
+ return (SOAPFaultException) ex;
+ }
+ if (ex.getCause() != null)
+ {
+ return findSoapFaultException(ex.getCause());
+ }
+ return null;
+ }
/**
* Compares two methods if they are identical.