axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r511759 - /webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCUtil.java
Date Mon, 26 Feb 2007 09:02:38 GMT
Author: deepal
Date: Mon Feb 26 01:02:38 2007
New Revision: 511759

URL: http://svn.apache.org/viewvc?view=rev&rev=511759
Log:
fixing AXIS2-2215

Modified:
    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/rpc/receivers/RPCUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCUtil.java?view=diff&rev=511759&r1=511758&r2=511759
==============================================================================
--- 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
Mon Feb 26 01:02:38 2007
@@ -27,6 +27,8 @@
 import javax.xml.stream.XMLStreamReader;
 import java.lang.reflect.Array;
 import java.lang.reflect.Method;
+import java.util.Collection;
+import java.util.Iterator;
 /*
 * Copyright 2004,2005 The Apache Software Foundation.
 *
@@ -210,14 +212,35 @@
                             objArray, service.isElementFormDefault(), service.getTypeTable());
                     envelope.getBody().addChild(bodyChild);
                 } else {
-                    if (service.isElementFormDefault()) {
-                        RPCUtil.processResponse(fac, resObject, bodyContent, ns,
-                                envelope, method, service.isElementFormDefault(),
+                    if(SimpleTypeMapper.isCollection(resObject.getClass())){
+                        Collection collection = (Collection) resObject;
+                        int size = collection.size();
+                        Object values [] = new Object[size];
+                        int count = 0;
+                        for (Iterator iterator = collection.iterator(); iterator.hasNext();)
+                        {
+                            values[count] = iterator.next();
+                            count ++;
+
+                        }
+                        QName resName = new QName(elementQName.getNamespaceURI(),
+                                method.getName() + "Response",
+                                elementQName.getPrefix());
+                        OMElement bodyChild = RPCUtil.getResponseElement(resName,
+                                values,
+                                service.isElementFormDefault(),
                                 service.getTypeTable());
+                        envelope.getBody().addChild(bodyChild);
                     } else {
-                        RPCUtil.processResponse(fac, resObject, bodyContent, ns,
-                                envelope, method, service.isElementFormDefault(),
-                                null);
+                        if (service.isElementFormDefault()) {
+                            RPCUtil.processResponse(fac, resObject, bodyContent, ns,
+                                    envelope, method, service.isElementFormDefault(),
+                                    service.getTypeTable());
+                        } else {
+                            RPCUtil.processResponse(fac, resObject, bodyContent, ns,
+                                    envelope, method, service.isElementFormDefault(),
+                                    null);
+                        }
                     }
                 }
             }



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


Mime
View raw message