You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ba...@apache.org on 2007/04/12 19:10:23 UTC

svn commit: r528044 - in /webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl: DescriptionUtils.java EndpointInterfaceDescriptionImpl.java OperationDescriptionImpl.java

Author: barrettj
Date: Thu Apr 12 10:10:22 2007
New Revision: 528044

URL: http://svn.apache.org/viewvc?view=rev&rev=528044
Log:
AXIS2-2422
Contributed by Roy Wood Jr.  The JAX-WS client operations should use the sync AxisOperation, not a newly created anonymous AxisOperation.

Modified:
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/DescriptionUtils.java
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointInterfaceDescriptionImpl.java
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java

Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/DescriptionUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/DescriptionUtils.java?view=diff&rev=528044&r1=528043&r2=528044
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/DescriptionUtils.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/DescriptionUtils.java Thu Apr 12 10:10:22 2007
@@ -28,8 +28,10 @@
 import org.apache.commons.logging.LogFactory;
 
 import javax.xml.namespace.QName;
+import javax.xml.ws.Response;
 import java.io.IOException;
 import java.io.InputStream;
+import java.lang.reflect.Method;
 import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URISyntaxException;
@@ -37,6 +39,7 @@
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.StringTokenizer;
+import java.util.concurrent.Future;
 
 /** Utilities used throughout the Description package. */
 class DescriptionUtils {
@@ -313,5 +316,26 @@
         return configStream;
     }
 
+    /**
+     * Determine is this method is an async method
+     * @param method - The method to examine
+     * @return
+     */
+    public static boolean isAsync(Method method) {
+
+        if (method == null) {
+            return false;
+        }
 
+        String methodName = method.getName();
+        Class returnType = method.getReturnType();
+
+        if (methodName.endsWith("Async")
+            && (returnType.isAssignableFrom(javax.xml.ws.Response.class) || returnType
+                .isAssignableFrom(java.util.concurrent.Future.class))) {
+            return true;
+        } else {
+            return false;
+        }
+    }
 }

Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointInterfaceDescriptionImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointInterfaceDescriptionImpl.java?view=diff&rev=528044&r1=528043&r2=528044
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointInterfaceDescriptionImpl.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointInterfaceDescriptionImpl.java Thu Apr 12 10:10:22 2007
@@ -319,9 +319,14 @@
                     for (OperationDescription checkOpDesc : updateOpDesc) {
                         if (checkOpDesc.getSEIMethod() == null) {
                             // TODO: Should this be checking (somehow) that the signature matches?  Probably not an issue until overloaded WSDL ops are supported.
-                            ((OperationDescriptionImpl)checkOpDesc).setSEIMethod(seiMethod);
-                            addOpDesc = false;
-                            break;
+                            
+                            //Make sure that this is not one of the 'async' methods associated with
+                            //this operation. If it is, let it be created as its own opDesc.
+                            if (!DescriptionUtils.isAsync(seiMethod)) {
+                                ((OperationDescriptionImpl) checkOpDesc).setSEIMethod(seiMethod);
+                                addOpDesc = false;
+                                break;
+                            }
                         }
                     }
                     if (addOpDesc) {

Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java?view=diff&rev=528044&r1=528043&r2=528044
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java Thu Apr 12 10:10:22 2007
@@ -357,6 +357,16 @@
     }
 
     public AxisOperation getAxisOperation() {
+        // Note that only the sync operations, and not the JAX-WS async client versions of an 
+        // operation, will have an AxisOperation associated with it.  For those async operations, 
+        // get the AxisOperation associated with the sync method and return that.
+        if (axisOperation == null) {
+            OperationDescription opDesc = getSyncOperation();
+            if (opDesc != null && opDesc != this) {
+                return getSyncOperation().getAxisOperation();
+            }
+        } 
+        
         return axisOperation;
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org