In response to my own post earlier, I'd like to share some additional info that 
I've just found.

When using WSDL first approach, I did see an xsi:type property on the generated
xml. And the objects do get de-serialized quite well. So polyporphism works 
here.
So that answers a part of my own question.

The trouble is with the POJO approach.
The generated xml is missing the xsi:type identifiers in this case. Hence, the 
de-serializer has no clue as to the correct instance of the object that the 
element
originated from.
Any reason why the POJO approach does not do this?


- Sathija.






Meghna Rao <[EMAIL PROTECTED]> wrote: Hello,

Does Axis2 support object polymorphism?

I've seen several JIRA issues that touch upon this one way or the other whether 
it is POJO approach or WSDL first approach.

I have been trying to send objects across the wire using web services and here 
is their structure.

                         Quadrilateral
                             /  \
                           /      \
                 Square          Rectangle

My service's signature looks like this:
public Quadrilateral retrieveQuadrilateral() {
      // return an instance of Square or Rectangle.
}

What I hoped to see was a properly deserialized instance of Square or Rectangle 
at the client side which is not happening.

I've inspected the SOAP response and there is no indicator in the xml for the 
deserializer to construct an object of the right instance.

Is this even supported by Axis?

Thanks,
Sathija.

           

---------------------------------
Ahhh...imagining that irresistible "new car" smell?
 Check out new cars at Yahoo! Autos. 

       
---------------------------------
Ahhh...imagining that irresistible "new car" smell?
 Check outnew cars at Yahoo! Autos.

Reply via email to