[
http://issues.apache.org/jira/browse/AXIS-2485?page=comments#action_12437774 ]
BEN ABDALLAH Adnene commented on AXIS-2485:
-------------------------------------------
Hi all,
It seems like this problem is related to the ArrayUtil static method :
public static Object ArrayUtil.convertObjectToArray(Object obj, Class
arrayType)
I propose the following patch to fix this problem. I am not sure it doesn't
have any undesirable side effect but it seems to be working. Can anybody verify
this patch and tell me if it is correct?
The patch is:
; Comparison of axis-1_4\src\org\apache\axis\utils\ArrayUtil.java.old and
axis-1_4\src\org\apache\axis\utils\ArrayUtil.java
; 9/26/2006 10:55:36 AM
;
copy 193
add 17
/**
* Gets the dimension of arrayType
* @param arrayType an array class
* @return the dimension
*/
public static Class getArrayComponentType(Class arrayType) {
if (!arrayType.isArray())
return arrayType;
Class compType = arrayType;
do {
arrayType = compType;
compType = arrayType.getComponentType();
} while (compType.isArray());
return compType;
}
copy 48
delete 1
add 5
if (pd == null) {
if (dim == 1 &&
destClass.isAssignableFrom(getArrayComponentType(array.getClass())) && arraylen
== 1) {
dest = Array.get(array, 0);
return dest;
}
copy 1
add 1
}
copy 41
> Output-Messages using soapenc:Array deserialize to arrays with null elements
> ----------------------------------------------------------------------------
>
> Key: AXIS-2485
> URL: http://issues.apache.org/jira/browse/AXIS-2485
> Project: Apache Axis
> Issue Type: Bug
> Components: Serialization/Deserialization
> Affects Versions: 1.3, 1.4
> Reporter: Thomas Jacob
>
> When using an output message with one parameter, whose type is a complex type
> using soapenc:Array, e.g.
> <complexType name="ProductArray">
> <complexContent>
> <restriction base="soapenc:Array">
> <attribute ref="soapenc:arrayType"
> wsdl:arrayType="product:Product[]"/>
> </restriction>
> </complexContent>
> </complexType>
> The response SOAP envelope is decoded incorrectly. First, it is decoded into
> an array of arrays, for example if the original response contains 3 elements,
> it is decoded into an array of 3 elements, each element being an array of 1
> element, containing the actual element (Product in this case).
> The mapper to Java types does not understand the inner arrays correctly, and
> transforms them into nulls.
> So eventually, the caller receives an array with 3 nulls.
> Using a complex type with a sequence of on element, set to
> maxOccurs="unbounded" works well, e.g.
> <complexType name="ProductArray">
> <sequence>
> <element name="elements" type="product:Product"
> maxOccurs="unbounded"/>
> </sequence>
> </complexType>
> Also, the complex type with soapenc:Array works fine for input messages, i.e.
> method parameters.
> Only soapenc:Array in the output does not work.
> The bug occurs in versions 1.3 and 1.4 of Axis. I don't know whether it also
> occurs in earlier versions.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]