Looks like the same problem described in the following bug reports:
https://issues.apache.org/jira/browse/AXIS-2280
https://issues.apache.org/jira/browse/AXIS-2267
They're fixed in SVN (they were fixed after Axis 1.3's release).
I believe a workaround would to be to set your field as follows:
> response.setItems(new SubItem[] {subItem})
#new Item[] -> new SubItem[]
Regards,
Dies
Schwanke, Kai wrote:
Hi there!
I got a problem with axis concerning inheritance. Here's a section of my
WSDL:
<xsd:complexType name="Item">
<xsd:sequence>
<xsd:element name="name" type="xsd:string"></xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="SubItem">
<xsd:complexContent>
<xsd:extension base="stp:Item">
<xsd:sequence>
<xsd:element name="length" type="xsd:int"></xsd:element>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
The files are generated correctly by wsdl2java with ant.
Then in the implementation I create a new Sub_Item:
SubItem subItem = new SubItem();
subItem.setLength(5);
subItem.setName("test");
I add this subItem to my response object by using.
response.setItems(new Item[] {subItem})
But the result checked with the soap monitor only shows my SubItem as
usual Item:
<response>
<item>
<name>test</name>
</item>
</response>
Hence my SubItem has been downcasted to a usual Item, loosing the
specific SubItem information.
Shouldn't this work different? Is there something I understand terribly
wrong?