Author: amilas
Date: Thu Mar 18 05:20:12 2010
New Revision: 924637
URL: http://svn.apache.org/viewvc?rev=924637&view=rev
Log:
Currently adb parsing avoids the local part check for the parts comes after an
array. For those part elements if the part is not
there becase of minOccurszero then those parts pase with the wrong class type.
so need to check the class type as above
Modified:
axis/axis2/java/core/trunk/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
Modified:
axis/axis2/java/core/trunk/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java?rev=924637&r1=924636&r2=924637&view=diff
==============================================================================
---
axis/axis2/java/core/trunk/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
(original)
+++
axis/axis2/java/core/trunk/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
Thu Mar 18 05:20:12 2010
@@ -574,12 +574,34 @@ public class BeanUtil {
omElement = ProcessElement(classType, omElement, helper, parts,
currentLocalName, retObjs, count, objectSupplier,
genericType);
while (omElement != null) {
- count ++;
- omElement = ProcessElement((Class)javaTypes[count], omElement,
+ count++;
+ // 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];
+ if (genericParameterTypes != null) {
+ genericType = genericParameterTypes[count];
+ }
+ omElement = ProcessElement((Class) javaTypes[count], omElement,
helper, parts, omElement.getLocalName(), retObjs,
count,
objectSupplier, genericType);
}
- count ++;
+ count++;
}
// Ensure that we have at least a zero element array