Author: alessio.soldano(a)jboss.com
Date: 2010-01-19 05:13:12 -0500 (Tue, 19 Jan 2010)
New Revision: 11458
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientProxy.java
Log:
[JBWS-2889] Make sure BindingProvider.getEndpointReference throws WebServiceException and
not InvocationTargetException
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientProxy.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientProxy.java 2010-01-19
10:03:43 UTC (rev 11457)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientProxy.java 2010-01-19
10:13:12 UTC (rev 11458)
@@ -22,6 +22,7 @@
package org.jboss.ws.core.jaxws.client;
import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.rmi.RemoteException;
import java.util.ArrayList;
@@ -102,8 +103,16 @@
String methodName = method.getName();
if (stubMethods.contains(method))
{
- Method stubMethod = ClientImpl.class.getMethod(methodName,
method.getParameterTypes());
- return stubMethod.invoke(client, args);
+ try
+ {
+ Method stubMethod = ClientImpl.class.getMethod(methodName,
method.getParameterTypes());
+ return stubMethod.invoke(client, args);
+ }
+ catch (InvocationTargetException ite) //unwrap the cause and re-throw as is if
it's a WebServiceException (spec requirement for getEndpointReference(..) for
instance)
+ {
+ Throwable cause = ite.getCause();
+ throw (cause != null && cause instanceof WebServiceException) ? cause
: ite;
+ }
}
// An invocation on proxy's Object class
Show replies by date