axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christophe Roudet" <crou...@activia.net>
Subject RE: Does Axis support polymorphism (dynamic send back the derived class)
Date Thu, 21 Oct 2004 17:34:32 GMT
If you generate your client from a wsdl (with wsdl2java) make sure that your
derived types are declared in.

   <complexType abstract="true" name="Shape">
    <sequence>
     <element name="size" type="xsd:int"/>
     ....
    </sequence>
   </complexType>

   <complexType name="Square">
    <complexContent>
     <extension base="tns1:Shape">
      <sequence>
        ....
      </sequence>
     </extension>
    </complexContent>
   </complexType>

Christophe

> -----Original Message-----
> From: Zhou Jian Han [mailto:zhan@ariodata.com]
> Sent: Thursday, October 21, 2004 1:02 PM
> To: axis-user@ws.apache.org
> Subject: Does Axis support polymorphism (dynamic send back the derived
> class)
> 
> Hi,
> I have a based class named Shape, and a derived class named Square( Square
> extends Shape).
> Is that possible I declare a method in service:
> public Shape getShape(int type) throws RemoteException
> and send back the Square Object?
> 
> By the way, I use gSoap(c/c++ soap) on server side, and apache Axis on
> client side, it looks like server send out the Square object, but client
> is not recognize the derived object, it is complain about "Invalid element
> in Shape- Square.size" (and 'size' is the field in Square, not in Shape).
> 
> Does any one have sample that polymorphism is working in Java Axis?
> 
> Thanks in Advance!
> Georgia




Mime
View raw message