Author: jim.ma
Date: 2010-03-25 07:46:52 -0400 (Thu, 25 Mar 2010)
New Revision: 11858
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientProxy.java
Log:
[JBPAPP-3962]:Throw WebServiceExeptio when the clazz is not assignableFrom
W3CEndpointReference
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientProxy.java
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientProxy.java 2010-03-25
09:53:08 UTC (rev 11857)
+++
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientProxy.java 2010-03-25
11:46:52 UTC (rev 11858)
@@ -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;
@@ -100,8 +101,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