axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Roder <mro...@wamnet.com>
Subject Issue - BeanSererializer encoding a property with only a readMeth od
Date Fri, 04 Jan 2002 21:05:21 GMT

The BeanSerializer is encoding properties that only have read methods but
not write methods.

I have a bean that contains a indexed property that is implimented using an
ArrayList instead of a array.  I have the full spectrum of the methods for
the indexed propery, but only a getList method for the ArrayList.

The multiple AssetRepresentation elements are getting encoded properly, but
then it encodes the List property.  This is fine in my application because
the axis is not used to process this on the server side, but if it was, then
axis would not be able to read this.


Here is the output I am seeing.
  <AssetRepresentationList>
    <AssetRepresentation>
     <AssetLocator>WG0000005940</AssetLocator>
     <DateCreated xsi:nil="true"/>
    </AssetRepresentation>
    <AssetRepresentation>
     <AssetLocator>WG0000005940</AssetLocator>
     <DateCreated xsi:nil="true"/>
    </AssetRepresentation>
    <List>
     <item>
      <AssetLocator>WG0000005940</AssetLocator>
      <DateCreated xsi:nil="true"/>
     </item>
     <item>
      <AssetLocator>WG0000005940</AssetLocator>
      <DateCreated xsi:nil="true"/>
     </item>
    </List>


Here is the object:

public class AssetRepresentationList extends AbstractValueObject
  {
  private List _assetRepresentations = new ArrayList();




  public void addAssetRepresentation(AssetRepresentation
assetRepresentation)
    {
    _assetRepresentations.add(assetRepresentation);
    }

  public List getList()
    {
    return _assetRepresentations;
    }



  //Indexed Bean Property for axis
  public void setAssetRepresentation(AssetRepresentation[] v)
    {
    _assetRepresentations = Arrays.asList(v);
    }


  public AssetRepresentation[] getAssetRepresentation()
    {
    return (AssetRepresentation[]) _assetRepresentations.toArray();
    }

  public void setAssetRepresentation(int i, AssetRepresentation v)
    {
    _assetRepresentations.add(i,v);
    }

  public AssetRepresentation  getAssetRepresentation(int i)
    {
    return (AssetRepresentation) _assetRepresentations.get(i);
    }


  }

Later

Mark

Mime
View raw message