axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wood...@apache.org
Subject svn commit: r817854 - in /webservices/axis2/trunk/java/modules/jaxws: src/org/apache/axis2/jaxws/marshaller/factory/MethodMarshallerFactory.java test/org/apache/axis2/jaxws/description/AnnotationDescriptionTests.java
Date Tue, 22 Sep 2009 21:52:04 GMT
Author: woodroy
Date: Tue Sep 22 21:52:01 2009
New Revision: 817854

URL: http://svn.apache.org/viewvc?rev=817854&view=rev
Log:
Fix isDocLitMinimalMethodMarshaller to look for responseWrapper only if the operation is not
oneWay
contributor: Roy Wood

Modified:
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/factory/MethodMarshallerFactory.java
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/description/AnnotationDescriptionTests.java

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/factory/MethodMarshallerFactory.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/factory/MethodMarshallerFactory.java?rev=817854&r1=817853&r2=817854&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/factory/MethodMarshallerFactory.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/factory/MethodMarshallerFactory.java
Tue Sep 22 21:52:01 2009
@@ -238,23 +238,38 @@
             MarshalServiceRuntimeDescription marshalDesc =
                     MarshalServiceRuntimeDescriptionFactory.get(serviceDesc);
             String requestWrapper = marshalDesc.getRequestWrapperClassName(op);
-            if (!exists(requestWrapper)) {
-            	if(log.isDebugEnabled()){
-            		log.debug("Request wrapper class name is NULL.");
-            	}
-                return true;
-            }
+            
+            
+            if (op.isOneWay()) {
+                if (!exists(requestWrapper)) {
+                        if(log.isDebugEnabled()){
+                                log.debug("OneWay Request wrapper class name is NULL.");
+                        }
+                        return true;
+                } 
+                
+                return false;
+            } else  { //This is 2-way or async so both wrappers should exist
+                if (!exists(requestWrapper)) {
+                    if(log.isDebugEnabled()){
+                        log.debug("Request wrapper class name is NULL.");
+                    }
+                    return true;
+                } 
 
-            //String responseWrapper = marshalDesc.getRequestWrapperClassName(op);
-            String responseWrapper = marshalDesc.getResponseWrapperClassName(op);
-            if (!exists(responseWrapper)) {
-            	if(log.isDebugEnabled()){
-            		log.debug("Response wrapper class name is NULL.");
-            	}
-                return true;
+                String responseWrapper = marshalDesc.getResponseWrapperClassName(op);
+                if (!exists(responseWrapper)) {
+                    if(log.isDebugEnabled()){
+                        log.debug("Response wrapper class name is NULL.");
+                    }
+                    return true;
+                }
+                
+                return false;
             }
             // TODO Do the same for the fault beans
         }
+        
         return false;
     }
 

Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/description/AnnotationDescriptionTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/description/AnnotationDescriptionTests.java?rev=817854&r1=817853&r2=817854&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/description/AnnotationDescriptionTests.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/description/AnnotationDescriptionTests.java
Tue Sep 22 21:52:01 2009
@@ -21,11 +21,14 @@
 package org.apache.axis2.jaxws.description;
 
 import junit.framework.TestCase;
-import org.apache.axis2.jaxws.spi.ServiceDelegate;
-
+import java.lang.reflect.Method;
 import javax.xml.namespace.QName;
 import javax.xml.ws.Service;
-import java.lang.reflect.Method;
+
+import org.apache.axis2.jaxws.marshaller.MethodMarshaller;
+import org.apache.axis2.jaxws.marshaller.factory.MethodMarshallerFactory;
+import org.apache.axis2.jaxws.marshaller.impl.alt.DocLitWrappedMethodMarshaller;
+import org.apache.axis2.jaxws.spi.ServiceDelegate;
 
 /**
  * Directly test the Description classes built via annotations without a WSDL file.
@@ -90,6 +93,14 @@
         // Verify an SEI method lookup works
         operationResult = endpointInterfaceDescription.getOperation(seiMethods[0]);
         assertNotNull(operationResult);
+        
+        //Verify OneWay Method is not minimal when there is a request wrapper        
+        OperationDescription oneWayOperation = endpointInterfaceDescription.getOperation("oneWayVoid");
+        
+        MethodMarshaller methodMarshaller = MethodMarshallerFactory.getMarshaller(oneWayOperation,
false);
+       
+        assertEquals("Method Marshaller class is incorrect for oneWay Doc/Lit/Wrapped operation",
DocLitWrappedMethodMarshaller.class, methodMarshaller.getClass());
+        
         // Verify a non-SEI method returns a null
         operationResult = endpointInterfaceDescription.getOperation(this.getClass().getMethods()[0]);
         assertNull(operationResult);



Mime
View raw message