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 Steve Green <st...@epok.net> on 2005/01/08 01:45:44 UTC

Serializing xs:list attributes

Developers,

I thought I had fixed a problem with list attributes, but it seems the
problem is more complicated than I thought.

Dims, if you're out there, put a hold on AXIS-1752 for the time being.

The problem appears to be for 2 reasons. 

1. wsdl2java does not generate the indexed getter and setter methods.
The bean introspector does not recognize the method as a list method and
thus the serializer fails when trying to serialize the "value". 

2. BeanSerializer doesn't have any code to serialize attributes that are
indexed.

Fixing #1 and #2 seemed simple enough, but after fixing them, another
problem cropped up which seems to be in direct conflict with #1.

wsdl2java has some code which generates the indexed getter and setter if
the qname of the element in question has a '[' in the local part.  For
my attribute list case, the local part of the qname is something like
">foo>bar".  I thought I could just use the typeName, and search for '['
but that breaks base64Binary types.  They end up getting serialized as a
collection of byte.

I can think of a couple ways to solve the problem, but once again, I am
not really confident as to the best way.

1.  The TypeEntry for the element in question has a member called
isSimpleType().  It seems to be set to 'false' for the base64Binary
case, and 'true' for the attribute list case.  Can anyone tell me if
that is a safe assumption to make?

2.  JavaBeanWriter already has a bunch of special code for base64Binary
and hexBinary.  I could create another special case. 

My inclination is #2, but before I clutter up JIRA anymore than I
already have, I'd like to get an opinion or two.

Thank you..

~S