gdaniels    2002/09/24 20:21:08

  Modified:    java/src/org/apache/axis/encoding
                        SerializationContextImpl.java
               java/src/org/apache/axis/encoding/ser ArraySerializer.java
  Log:
  Fix http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12685
  
  Always serialize an xsi:type attribute if serializing a derived type, regardless
  of the "send xsi types" setting.
  
  Revision  Changes    Path
  1.73      +6 -4      
xml-axis/java/src/org/apache/axis/encoding/SerializationContextImpl.java
  
  Index: SerializationContextImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/encoding/SerializationContextImpl.java,v
  retrieving revision 1.72
  retrieving revision 1.73
  diff -u -r1.72 -r1.73
  --- SerializationContextImpl.java     22 Sep 2002 17:26:28 -0000      1.72
  +++ SerializationContextImpl.java     25 Sep 2002 03:21:08 -0000      1.73
  @@ -1203,11 +1203,13 @@
   
               if ( ser != null ) {
                   // Send the xmlType if indicated.
  -                if (shouldSendType) {
  -                    xmlType = ((TypeMappingImpl)tm).getXMLType(javaType,
  +                QName actualType = ((TypeMappingImpl)tm).getXMLType(javaType,
                                                                  xmlType);
  -                    attributes = setTypeAttribute(attributes, xmlType);
  -                }
  +                
  +                if (shouldSendType || (xmlType != null &&
  +                                        (!actualType.equals(xmlType))))
  +                    attributes = setTypeAttribute(attributes, actualType);
  +                
                   // The multiref QName is our own fake name.
                   // It may be beneficial to set the name to the
                   // type name, but I didn't see any improvements
  
  
  
  1.36      +0 -1      
xml-axis/java/src/org/apache/axis/encoding/ser/ArraySerializer.java
  
  Index: ArraySerializer.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/ArraySerializer.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- ArraySerializer.java      24 Sep 2002 16:03:37 -0000      1.35
  +++ ArraySerializer.java      25 Sep 2002 03:21:08 -0000      1.36
  @@ -58,7 +58,6 @@
   import org.apache.axis.Constants;
   import org.apache.axis.encoding.SerializationContext;
   import org.apache.axis.encoding.Serializer;
  -import org.apache.axis.utils.JavaUtils;
   import org.apache.axis.utils.Messages;
   import org.apache.axis.wsdl.fromJava.Types;
   
  
  
  


Reply via email to