Hi
 
yes exactly that! so i am not the only one to find this problem so in my other post i look into the axis source code and i find where it happens in the code source:
 
in the axis code 1.3:
 
package org.apache.axis.encoding.SerializationContext
class SerializationContext:
private void serializeActual(QName elemQName,
                                Attributes attributes,
                                Object value,
                                QName xmlType,
                                Class javaClass,
                                Boolean sendType)
        throws IOException
    {...........
    Class javaType = getActualJavaClass(xmlType, javaClass, value);
           
 
in axis  code 1.2.1:

       private void serializeActual(QName elemQName,
                                Attributes attributes,
                                Object value,
                                QName xmlType,
                                Boolean sendType)
        throws IOException
    {
        .......
        if (value != null) {
            Class javaType = value.getClass();
            TypeMapping tm = getTypeMapping();
 
so i tried to replace getActualJavaClass with value.getClass() now it works
but i have not tested the effects of this solution, so it needs to look in the getActualJavaClass who seems to give problems.....and to modify it but i have not enough time to do more for the moment it is just a good start.....
 

 
 


"Dies Koper (JIRA)" <axis-dev@ws.apache.org> a écrit :
[ http://issues.apache.org/jira/browse/AXIS-2280?page=comments#action_12363513 ]

Dies Koper commented on AXIS-2280:
----------------------------------

I have reproduced this problem in my environment and would like to note something that I think is rather important to this issue.

Base class: Data (field: String name)
Subclass: MoreData (field: int size)
method parameter: Data[]

client test 1 (OK):
creates Data array with "new Data{xx}" passing Data instance
SOAP message shows data field; impl receives data instance

client test 2 (NG<- point of this Bug):
creates Data array with "new Data{xx}" passing MoreData instance
SOAP message shows data field, no size field; impl receives Data instance

client test 3 ((almost)OK<- I added as missing link):
creates MoreData array with "new MoreData{xx}" passing MoreData instance
SOAP messa ge shows data and size fields; impl receives MoreData instance
BUT: the array containing the MoreData instance is of type Data[], not MoreData[], so returning this to the client gives the same problem as in test 2 again.

=> I assume Axis serializer checks instance of the array, not of its elements, and assumes all elements would be of the same type. Also, should the deserializer create the array (not just the elements) using the same type as the elements, not the base type?

[workaround?]
See client test 3: use the same (sub)type for the array reference as the elements you want to transmit.
#What if you have elements of different subclasses of the base class? Hmm..


[Relevant parts of SOAP requests]
test 1:

data


test 2:

moreData


test3:

moreData
11




> Array elements of derived (XSD extension type) are not serialized correctly
> ---------------------------------------------------------------------------
>
> Key: AXIS-2280
> URL: http://issues.apache.org/jira/browse/AXIS-2280
> Project: Apache Axis
> Type: Bug
> Components: Serialization/Deserialization
> Versions: 1.3
> Reporter: Peter Canning
> Priority: Blocker
> Attachments: arrayExtensionTest.wsdl, arrayExtensionTestClient.java, src_with_more_stdout.zip
>
> This is a regression from Axis (Java) 1.2.1.
> If an operation take a parameter whose type is an array (maxOccurs="unbounded") of a base type, and the client passes an array containing a value whose type is derived (an XSD extension) from the base type, the value is serialized as the base type, and the additional elements in the derived type are omitted. In addtion the element for the value is missing the expected xsi:type attribute.
> I will attach an example to demonstate the problem.

--
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



Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international. Téléchargez la version beta.