axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christophe Roudet" <>
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">
     <element name="size" type="xsd:int"/>

   <complexType name="Square">
     <extension base="tns1:Shape">


> -----Original Message-----
> From: Zhou Jian Han []
> Sent: Thursday, October 21, 2004 1:02 PM
> To:
> 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

View raw message