You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by bu...@apache.org on 2002/10/31 16:27:02 UTC

DO NOT REPLY [Bug 14130] New: - Type is not used during serialization of MessageElement.

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14130>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14130

Type is not used during serialization of MessageElement.

           Summary: Type is not used during serialization of MessageElement.
           Product: Axis
           Version: 1.0
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Serialization/Deserialization
        AssignedTo: axis-dev@xml.apache.org
        ReportedBy: chrisw@wolfram.com


When setType(QName qname) is called on a MessageElement, the type is set within 
the MessageElement, but not used during Serialization.  

Example....

### SetTypeTest.java ###

import org.apache.axis.message.MessageElement;
import javax.xml.namespace.QName;

public class SetTypeTest
{
  public SetTypeTest()
  {
  }
  
  public static void main(String[] args)
  { 
    try
    {
      MessageElement me = new MessageElement("http://www.wolfram.com","Test");
      me.setType(new QName("http://www.wolfram.com", "Type1"));
      MessageElement me2 = new MessageElement
("http://www.wolfram.com", "Child", (Object)"1");
      me2.setType(new QName("http://www.w3.org/2001/XMLSchema", "int"));
      me.addChildElement(me2);
      System.out.println(me.toString());
      System.out.println("me type: " + me.getType());
      System.out.println("me2 type: " + me2.getType());
    }
    catch(Exception e)
    {
      e.printStackTrace();
    }
  }
}

Result (I fixed up the xml to make it more readible)...

<ns1:Test xmlns:ns1="http://www.wolfram.com">
  <ns1:Child xsi:type="xsd:string" 
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
             xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    1
  </ns1:Child>
</ns1:Test>
me type: {http://www.wolfram.com}Type1
me2 type: {http://www.w3.org/2001/XMLSchema}int

You will notice that even though the type is explicitly set, it is not used 
during serialization in either the first element or the second element.  In the 
second element, the type is set, but it is set to something other than what was 
specified.