Hi,
i am using the latest released Axis verison (Axis 1.1).
For some reason, i have problem getting attribute defined in the parent
complex type to be serialized.
In my schema, i have something like the following:
// child type
<xs:complexType name="AType">
<xs:complexContent>
<xs:extension base="ns2:AbstractAType">
<xs:sequence>
<xs:element ref="ns2:id"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
// parent type that contains an attribute and an element
<xs:complexType name="AbstractAType" abstract="true">
<xs:attribute name="a" type="xs:string" use="optional"/>
<xs:element name="e" type="ns:BType">
...
</xs:complexType>
When i ran WSDL2Java to generate the stub for the client, it was
able to generate the 2 java files properly . In my client code, i
explicitly the set value of
the attribute and element of object AType, which inherits them from
AbstractAType. However, in the SOAP message that gets sent over the wire,
the attribute a is always getting dropped. The element e though, is
serialized properly.
I spent some time to look at the actual generated AType.java and
AbstractAType.java, and i noticed one strange behavior.
The typeDesc private member in AType doesn't know about the TypeDesc
private member in AbstractAType, and doesn't references it what so ever.
So when calling the BeanSerializer and passing in that typeDesc, it
only contains the AType type desc information, but not the parent's
(AbstractAType) one (in this case, that contains the element and attribute).
So how come somehow the element was still able to be retrieved and
serialized not the attribute?
any idea?
thanks
gary