You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Mark D. Hansen" <kh...@yahoo.com> on 2005/04/08 20:28:04 UTC

proper serialization of Object[] array ... (xsd or soapenc item types??)

I'm starting with this Java array:

  private final String itemString = "a string instance";
  private final Integer itemInteger = new Integer("1965");
  private final Float itemFloat = new Float("3.14159");
  private final Boolean itemBoolean = new Boolean(true);
  private final Object[] arrayOfObjects = 
    new Object[] { itemString, itemInteger, itemFloat, itemBoolean };

Using this default serialization context:

    SerializationContext context = 
      new SerializationContext(writer, new MessageContext(new AxisServer()));

Here is what I get:

<... soapenc:arrayType="xsd:anyType[4]" xsi:type="soapenc:Array" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ...>
  <item xsi:type="soapenc:string">a string instance</item>
  <item xsi:type="soapenc:int">1965</item>
  <item xsi:type="soapenc:float">3.14159</item>
  <item xsi:type="soapenc:boolean">true</item>
<...>

Is this correct?  Am I supposed to get soapenc types for the array items?  Per WS-I, should I get xsd types for the items?

Thanks for any help,

Mark