geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r164489 - in /geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/client: OperationInfo.java ServiceEndpointMethodInterceptor.java
Date Sun, 24 Apr 2005 17:10:15 GMT
Author: djencks
Date: Sun Apr 24 10:10:13 2005
New Revision: 164489

URL: http://svn.apache.org/viewcvs?rev=164489&view=rev
Log:
unwrap faults

Modified:
    geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/client/OperationInfo.java
    geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/client/ServiceEndpointMethodInterceptor.java

Modified: geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/client/OperationInfo.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/client/OperationInfo.java?rev=164489&r1=164488&r2=164489&view=diff
==============================================================================
--- geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/client/OperationInfo.java
(original)
+++ geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/client/OperationInfo.java
Sun Apr 24 10:10:13 2005
@@ -17,12 +17,15 @@
 package org.apache.geronimo.axis.client;
 
 import java.io.Serializable;
+import java.rmi.RemoteException;
 
 import javax.xml.namespace.QName;
 
 import org.apache.axis.description.OperationDesc;
+import org.apache.axis.description.FaultDesc;
 import org.apache.axis.client.Call;
 import org.apache.axis.soap.SOAPConstants;
+import org.apache.axis.AxisFault;
 import net.sf.cglib.core.Signature;
 
 /**
@@ -81,5 +84,15 @@
         //GAH!!!
         call.setOperationStyle(operationDesc.getStyle());
         call.setOperationUse(operationDesc.getUse());
+    }
+
+    public Throwable unwrapFault(RemoteException re) {
+        if (re instanceof AxisFault && re.getCause() != null) {
+            Throwable t = re.getCause();
+            if (operationDesc.getFaultByClass(t.getClass()) != null) {
+                return t;
+            }
+        }
+        return re;
     }
 }

Modified: geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/client/ServiceEndpointMethodInterceptor.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/client/ServiceEndpointMethodInterceptor.java?rev=164489&r1=164488&r2=164489&view=diff
==============================================================================
--- geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/client/ServiceEndpointMethodInterceptor.java
(original)
+++ geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/client/ServiceEndpointMethodInterceptor.java
Sun Apr 24 10:10:13 2005
@@ -17,6 +17,7 @@
 package org.apache.geronimo.axis.client;
 
 import java.lang.reflect.Method;
+import java.rmi.RemoteException;
 import java.util.Arrays;
 import java.util.Iterator;
 import java.util.Set;
@@ -77,10 +78,15 @@
                 }
             }
         }
-        java.lang.Object response = call.invoke(objects);
+        Object response = null;
+        try {
+            response = call.invoke(objects);
+        } catch (RemoteException e) {
+            throw operationInfo.unwrapFault(e);
+        }
 
         if (response instanceof java.rmi.RemoteException) {
-            throw (java.rmi.RemoteException)response;
+            throw operationInfo.unwrapFault((RemoteException) response);
         }
         else {
             stub.extractAttachments(call);



Mime
View raw message