axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From françois françois <fv...@yahoo.fr>
Subject BUG OR NOTA BUG in array serialization in AXIS 1.3?
Date Fri, 20 Jan 2006 10:43:37 GMT
Hi
   
  see my post below....i was in document wrapped literal
  is this error specific in document wrapped literal ?
  In code source AXIS 1.3 in 
    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);
            
getActualJavaClass ? seems not to be correct
  anyone reports this bugs?
   
  Thanks

françois françois <fvdev@yahoo.fr> a écrit :


    Hi 
   
  when i migrate to AXIS 1.2.1 to AXIS 1.3
I have got some problems with Array and inheritance 
example :
 i have tried to migrate from axis 1.2.1 to axis 1.3
it seems that the ArraySerializer has changed between this 2 versions
and it caused some problems with inheritance:
If you ve got for example: an abstract class animal and a class dog who extends animal
and an Array of animal
so in this way :
public abstract class Animal{
private String nom;
......
}
public class Dog extends Animal{
private String color;
........
}
your webservice expose this method below for example:
public Animal [] getListOfAnimals(){
Animal [] array_Animals=new Animals[1];
Dog doggy= new doggy("pluto","black");
array_Animals[0]=doggy;
return array_Animals;
}
In axis 1.3 when you call getListOfAnimals(), you lost the informations of Dog so you receive
to your client
only an array which contains Animal type Object  but not Dog objects and the client failed
: instantiation exception....
In axis 1.2.1 you still have  the information that the function getListOfAnimals() return
an array of Animal which contains 
Dog objects.
I use document/wrapped literal
   
  so I look 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:
  
      &nbs p;  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();
  
I tried to replace in axis 1.3  getActualJavaClass(xmlType, javaClass, value) with value.getClass()
likein AXIS 1.2.1;
now it seems to work but i don't know if it is the good solution.....
perhaps the problem seems to be in the method getActualJavaClass.
  what do you think? is anyone found this problem?
   
  thanks
  
 
    
---------------------------------
  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.  


		
---------------------------------
 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.
Mime
View raw message