axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Schwanke, Kai" <kai.schwa...@cgi.com>
Subject axis soap inheritance question
Date Wed, 15 Feb 2006 13:37:34 GMT
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? 

 

Thanks for your answers.

 

Kai

 


Mime
View raw message