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 Meghna Rao <de...@yahoo.com> on 2007/04/18 21:32:56 UTC

Axis2 and polymorphism

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 outnew cars at Yahoo! Autos.

Re: Axis2 and polymorphism

Posted by Amila Suriarachchi <am...@gmail.com>.
On 4/19/07, Dennis Sosnoski <dm...@sosnoski.com> wrote:
>
> Hi Sathija,
>
> With this, as with most aspects of schema support, it comes down to the
> actual data binding framework you're using. JiBX supports polymorphism
> using the equivalent of schema substitution groups (where different
> element names are used to distinguish between the different types of
> derived structures). I believe XMLBeans has very good support for
> polymorphism using type substitution (where the element name is always
> the same, but the actual type is given in the instance document using an
> xsi:type="..." attribute of the element), though it has a more difficult
> time with substitution groups.
>
> I don't know what form of support ADB provides for polymorphism.


It fully support the polymorphism by using the xsi:type to find the actuall
instance.

  - Dennis
>
> Dennis M. Sosnoski
> SOA and Web Services in Java
> Training and Consulting
> http://www.sosnoski.com - http://www.sosnoski.co.nz
> Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117
>
>
>
> Meghna Rao 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.
> > <
> http://us.rd.yahoo.com/evt=48245/*http://autos.yahoo.com/new_cars.html;_ylc=X3oDMTE1YW1jcXJ2BF9TAzk3MTA3MDc2BHNlYwNtYWlsdGFncwRzbGsDbmV3LWNhcnM-
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
Amila Suriarachchi,
WSO2 Inc.

Re: Axis2 and polymorphism

Posted by Meghna Rao <de...@yahoo.com>.
Amila,

I am having the same issue using the RC2 version. 
With WSDL approach where I generate the service and client stubs, it works quite well.
The problem is with the POJO approach.
I noticed that xsi:type is missing in the xml with this approach. 

Thanks,
Sathija.


Amila Suriarachchi <am...@gmail.com> wrote: 

On 4/19/07, Meghna Rao <de...@yahoo.com> wrote: Thanks Dennis for sharing that.
ADB is what I am using.
What is the version you use? if you have problems with axis2-1.1.1  please have a  look at with the RC2. 


 Dennis Sosnoski <dm...@sosnoski.com> wrote: 
 Hi Sathija,

With this, as with most aspects of schema support, it comes down to the  
actual data binding framework you're using. JiBX supports polymorphism 
using the equivalent of schema substitution groups (where different 
element names are used to distinguish between the different types of  
derived structures). I believe XMLBeans has very good support for 
polymorphism using type substitution (where the element name is always 
the same, but the actual type is given in the instance document using an  
xsi:type="..." attribute of the element), though it has a more difficult 
time with substitution groups.

I don't know what form of support ADB provides for polymorphism.

  -  Dennis

Dennis M. Sosnoski
SOA and Web Services in Java
Training and Consulting
http://www.sosnoski.com  - http://www.sosnoski.co.nz
Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117



 Meghna Rao 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. 
>  



---------------------------------------------------------------------
To unsubscribe, e-mail:  axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org 


         

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




-- 
Amila Suriarachchi,
WSO2 Inc. 

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

Re: is there any platform limitations for AXIS 2.0?

Posted by Deepal Jayasinghe <de...@opensource.lk>.
Hi Hitesh;

AFAIK there is no such a limitation (since Axis2 is implemented using
Java) , did you encounter any issue?

Thanks
Deepal

> Dear All,
>  
> Is there any platform limitations for AXIS 2, especially for AIX and
> HP-Unix?
>  
> Cud you pl share good pointers regarding same.
>  
>  
> Thanks,
> Hitesh
>  


-- 
Thanks,
Deepal
................................................................
"The highest tower is built one brick at a time"




---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: is there any platform limitations for AXIS 2.0?

Posted by Davanum Srinivas <da...@gmail.com>.
Any box with JDK1.4+ is ok. We don't use any native code.

-- dims

On 4/19/07, Hitesh Raghav <Hi...@symantec.com> wrote:
>
>
>
> Dear All,
>
> Is there any platform limitations for AXIS 2, especially for AIX and
> HP-Unix?
>
> Cud you pl share good pointers regarding same.
>
>
> Thanks,
> Hitesh
>


-- 
Davanum Srinivas :: http://wso2.org/ :: Oxygen for Web Services Developers

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


is there any platform limitations for AXIS 2.0?

Posted by Hitesh Raghav <Hi...@symantec.com>.
Dear All,
 
Is there any platform limitations for AXIS 2, especially for AIX and
HP-Unix?
 
Cud you pl share good pointers regarding same.
 
 
Thanks,
Hitesh
 

Re: Axis2 and polymorphism

Posted by Amila Suriarachchi <am...@gmail.com>.
On 4/19/07, Meghna Rao <de...@yahoo.com> wrote:
>
> Thanks Dennis for sharing that.
> ADB is what I am using.


What is the version you use? if you have problems with axis2-1.1.1  please
have a  look at with the RC2.

*Dennis Sosnoski <dm...@sosnoski.com>* wrote:
>
> Hi Sathija,
>
> With this, as with most aspects of schema support, it comes down to the
> actual data binding framework you're using. JiBX supports polymorphism
> using the equivalent of schema substitution groups (where different
> element names are used to distinguish between the different types of
> derived structures). I believe XMLBeans has very good support for
> polymorphism using type substitution (where the element name is always
> the same, but the actual type is given in the instance document using an
> xsi:type="..." attribute of the element), though it has a more difficult
> time with substitution groups.
>
> I don't know what form of support ADB provides for polymorphism.
>
> - Dennis
>
> Dennis M. Sosnoski
> SOA and Web Services in Java
> Training and Consulting
> http://www.sosnoski.com - http://www.sosnoski.co.nz
> Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117
>
>
>
> Meghna Rao 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.
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
> ------------------------------
> Ahhh...imagining that irresistible "new car" smell?
> Check out new cars at Yahoo! Autos.<http://us.rd.yahoo.com/evt=48245/*http://autos.yahoo.com/new_cars.html;_ylc=X3oDMTE1YW1jcXJ2BF9TAzk3MTA3MDc2BHNlYwNtYWlsdGFncwRzbGsDbmV3LWNhcnM->
>
>


-- 
Amila Suriarachchi,
WSO2 Inc.

Re: Axis2 and polymorphism

Posted by Meghna Rao <de...@yahoo.com>.
Thanks Dennis for sharing that.
ADB is what I am using.



Dennis Sosnoski <dm...@sosnoski.com> wrote: Hi Sathija,

With this, as with most aspects of schema support, it comes down to the 
actual data binding framework you're using. JiBX supports polymorphism 
using the equivalent of schema substitution groups (where different 
element names are used to distinguish between the different types of 
derived structures). I believe XMLBeans has very good support for 
polymorphism using type substitution (where the element name is always 
the same, but the actual type is given in the instance document using an 
xsi:type="..." attribute of the element), though it has a more difficult 
time with substitution groups.

I don't know what form of support ADB provides for polymorphism.

  - Dennis

Dennis M. Sosnoski
SOA and Web Services in Java
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117



Meghna Rao 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. 
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org



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

Re: Axis2 and polymorphism

Posted by Dennis Sosnoski <dm...@sosnoski.com>.
Hi Sathija,

With this, as with most aspects of schema support, it comes down to the 
actual data binding framework you're using. JiBX supports polymorphism 
using the equivalent of schema substitution groups (where different 
element names are used to distinguish between the different types of 
derived structures). I believe XMLBeans has very good support for 
polymorphism using type substitution (where the element name is always 
the same, but the actual type is given in the instance document using an 
xsi:type="..." attribute of the element), though it has a more difficult 
time with substitution groups.

I don't know what form of support ADB provides for polymorphism.

  - Dennis

Dennis M. Sosnoski
SOA and Web Services in Java
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117



Meghna Rao 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. 
> <http://us.rd.yahoo.com/evt=48245/*http://autos.yahoo.com/new_cars.html;_ylc=X3oDMTE1YW1jcXJ2BF9TAzk3MTA3MDc2BHNlYwNtYWlsdGFncwRzbGsDbmV3LWNhcnM-> 


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Axis2 and polymorphism

Posted by Igor Dayen <ig...@ix.netcom.com>.
Is Quadrilateral defined as abstract class? 
If so  - I expect it will be translated into abstract type in WSDL, with subsequent permitting polymorphic types in method signatures.
  ----- Original Message ----- 
  From: Meghna Rao 
  To: axis-user@ws.apache.org 
  Sent: Wednesday, April 18, 2007 3:32 PM
  Subject: Axis2 and polymorphism


  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. 

Re: Axis2 and polymorphism

Posted by Meghna Rao <de...@yahoo.com>.
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 <de...@yahoo.com> 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.