ws-axis-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r372098 - in /webservices/axis2/trunk/java/modules: adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java adb/src/org/apache/axis2/databinding/utils/BeanUtil.java wsdl/src/org/apache/axis2/wsdl/java2wsdl/SchemaGenerator.java
Date Wed, 25 Jan 2006 04:07:38 GMT
Author: deepal
Date: Tue Jan 24 20:07:21 2006
New Revision: 372098

URL: http://svn.apache.org/viewcvs?rev=372098&view=rev
Log:
- fixed problem in BeanUtil when serializing a Bean 

Modified:
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
    webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/java2wsdl/SchemaGenerator.java

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java?rev=372098&r1=372097&r2=372098&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java
(original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java
Tue Jan 24 20:07:21 2006
@@ -139,7 +139,7 @@
         return ARRAY_LIST.equals(objClassName);
     }
 
-    private static boolean isSimpleType(String objClassName) {
+    public static boolean isSimpleType(String objClassName) {
         if (objClassName.equals(STRING)) {
             return true;
         } else if (objClassName.equals(INT)) {

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java?rev=372098&r1=372097&r2=372098&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
Tue Jan 24 20:07:21 2006
@@ -62,6 +62,22 @@
                     Object value = propDesc.getReadMethod().invoke(beanObject, null);
                     object.add(propDesc.getName());
                     object.add(value.toString());
+                } else if (ptype.isArray()) {
+                    Object value [] = (Object[]) propDesc.getReadMethod().invoke(beanObject,
null);
+                    if (SimpleTypeMapper.isSimpleType(ptype.getComponentType())) {
+                        for (int j = 0; j < value.length; j++) {
+                            Object o = value[j];
+                            object.add(propDesc.getName());
+                            object.add(o.toString());
+                        }
+                    } else {
+                         for (int j = 0; j < value.length; j++) {
+                            Object o = value[j];
+                            object.add(new QName(propDesc.getName()));
+                            object.add(o);
+                        }
+                    }
+
                 } else if (SimpleTypeMapper.isArrayList(ptype)) {
                     Object value = propDesc.getReadMethod().invoke(beanObject, null);
                     ArrayList objList = (ArrayList) value;

Modified: webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/java2wsdl/SchemaGenerator.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/java2wsdl/SchemaGenerator.java?rev=372098&r1=372097&r2=372098&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/java2wsdl/SchemaGenerator.java
(original)
+++ webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/java2wsdl/SchemaGenerator.java
Tue Jan 24 20:07:21 2006
@@ -360,7 +360,7 @@
                     sequence.getItems().add(elt1);
                     if (isArryType) {
                         elt1.setMaxOccurs(Long.MAX_VALUE);
-                        elt1.setMinOccurs(Long.MIN_VALUE);
+                        elt1.setMinOccurs(0);
 //                        elt1.setMinOccurs(2);
                     }
                 } else {
@@ -375,7 +375,7 @@
                     sequence.getItems().add(elt1);
                     if (isArryType) {
                         elt1.setMaxOccurs(Long.MAX_VALUE);
-                        elt1.setMinOccurs(Long.MIN_VALUE);
+                        elt1.setMinOccurs(0);
                     }
                 }
             }



Mime
View raw message