axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ami...@apache.org
Subject svn commit: r739179 - in /webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2: databinding/utils/BeanUtil.java rpc/receivers/RPCUtil.java
Date Fri, 30 Jan 2009 05:34:27 GMT
Author: amilas
Date: Fri Jan 30 05:34:26 2009
New Revision: 739179

URL: http://svn.apache.org/viewvc?rev=739179&view=rev
Log:
fixed the issue AXIS2-4223

Modified:
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCUtil.java

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java?rev=739179&r1=739178&r2=739179&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
(original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
Fri Jan 30 05:34:26 2009
@@ -515,6 +515,12 @@
     public static Object [] deserialize(OMElement response,
                                         Object [] javaTypes,
                                         ObjectSupplier objectSupplier) throws AxisFault {
+        return BeanUtil.deserialize(response, javaTypes, objectSupplier, null);
+    }
+    public static Object [] deserialize(OMElement response,
+                                        Object [] javaTypes,
+                                        ObjectSupplier objectSupplier,
+                                        String[] parameterNames) throws AxisFault {
         /*
          * Take the number of parameters in the method and , only take that much of child
elements
          * from the OMElement , other are ignore , as an example
@@ -562,6 +568,24 @@
             } else {
                 continue;
             }
+
+             // if the local part is not match. this means element is not present
+            // due to min occurs zero.
+            // we need to hard code arg and item since that has been used in RPCService client
+            // and some test cases
+            while ((parameterNames != null) &&
+                    (!omElement.getQName().getLocalPart().startsWith("arg")) &&
+                    (!omElement.getQName().getLocalPart().startsWith("item")) &&
+                    !omElement.getQName().getLocalPart().equals(parameterNames[count])) {
+                // POJO handles OMElement in a differnt way so need this check for OMElement
+                Class paramClassType = (Class) javaTypes[count];
+                if (!paramClassType.getName().equals(OMElement.class.getName())) {
+                    count++;
+                } else {
+                    break;
+                }
+            }
+
             currentLocalName = omElement.getLocalName();
             classType = (Class)javaTypes[count];
             omElement = ProcessElement(classType, omElement, helper, parts,

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCUtil.java?rev=739179&r1=739178&r2=739179&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCUtil.java
(original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCUtil.java
Fri Jan 30 05:34:26 2009
@@ -35,6 +35,7 @@
 import org.apache.axis2.databinding.utils.reader.NullXMLStreamReader;
 import org.apache.axis2.description.AxisMessage;
 import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.Parameter;
 import org.apache.axis2.description.java2wsdl.TypeTable;
 import org.apache.axis2.engine.ObjectSupplier;
 import org.apache.axis2.util.StreamWrapper;
@@ -145,12 +146,17 @@
         }
     }
 
+    public static Object[] processRequest(OMElement methodElement,
+                                          Method method, ObjectSupplier objectSupplier, String[]
parameterNames)
+            throws AxisFault {
+        Class[] parameters = method.getParameterTypes();
+        return BeanUtil.deserialize(methodElement, parameters, objectSupplier, parameterNames);
+    }
 
     public static Object[] processRequest(OMElement methodElement,
                                           Method method, ObjectSupplier objectSupplier)
             throws AxisFault {
-        Class[] parameters = method.getParameterTypes();
-        return BeanUtil.deserialize(methodElement, parameters, objectSupplier);
+        return processRequest(methodElement, method, objectSupplier, null);
     }
 
     public static Object invokeServiceClass(AxisMessage inAxisMessage,
@@ -185,8 +191,13 @@
             }
             Object[] objectArray;
             if (inAxisMessage.isWrapped()) {
+                Parameter namesParameter = inMessage.getAxisService().getParameter(method.getName());
+                String[] parameterNames = null;
+                if (namesParameter != null){
+                    parameterNames = (String[]) namesParameter.getValue();
+                }
                 objectArray = RPCUtil.processRequest(methodElement,
-                        method, inMessage.getAxisService().getObjectSupplier());
+                        method, inMessage.getAxisService().getObjectSupplier(), parameterNames);
             } else {
                 objectArray = RPCUtil.processRequest((OMElement) methodElement.getParent(),
                         method, inMessage.getAxisService().getObjectSupplier());



Mime
View raw message