You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by breaks <as...@yahoo.com> on 2008/07/24 13:25:45 UTC
Polymorphism in Axis2
Hi,
Excuse the simple question:
Consider the following simple polymorphic arrangement:
Dog and Cat both extending from Animal.
If I send a list of Animals from client to server, which contains both cats
and dogs, I can see the soap message containing animals which then reference
dog and cat types as:
<ns2:Animal xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="ns2:Dog">...
<ns2:Animal xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="ns2:Cat">...
However on the server side, they are created as Animal objects, not Dogs or
Cats!
XSD for Dog and Cat is the same style. E.g.
<include schemaLocation="Animal.xsd"></include>
<complexType name="Dog">
<complexContent>
<extension base="types:Animal">
<sequence>
...
Animal XSD would be:
<complexType name="Animal">
<sequence>
...
Anything I am doing wrong or is this an obvious limitation with Axis2?
Cheers
Alex
--
View this message in context: http://www.nabble.com/Polymorphism-in-Axis2-tp18629939p18629939.html
Sent from the Axis - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: Polymorphism in Axis2
Posted by Samisa Abeysinghe <sa...@gmail.com>.
If you have the schema and the WSDL in place, you can use WSDL2Java tool
to see how Axis2 handles that.
Samisa...
breaks wrote:
> Hi,
> Excuse the simple question:
>
> Consider the following simple polymorphic arrangement:
> Dog and Cat both extending from Animal.
>
> If I send a list of Animals from client to server, which contains both cats
> and dogs, I can see the soap message containing animals which then reference
> dog and cat types as:
>
> <ns2:Animal xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:type="ns2:Dog">...
> <ns2:Animal xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:type="ns2:Cat">...
>
> However on the server side, they are created as Animal objects, not Dogs or
> Cats!
>
> XSD for Dog and Cat is the same style. E.g.
>
> <include schemaLocation="Animal.xsd"></include>
> <complexType name="Dog">
> <complexContent>
> <extension base="types:Animal">
> <sequence>
> ...
>
> Animal XSD would be:
>
>
> <complexType name="Animal">
> <sequence>
> ...
>
>
> Anything I am doing wrong or is this an obvious limitation with Axis2?
>
> Cheers
> Alex
>
>
>
>
>
--
Samisa Abeysinghe
http://people.apache.org/~samisa/
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org