You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Aaron Gourley (JIRA)" <ji...@apache.org> on 2008/03/23 16:07:24 UTC

[jira] Created: (AXIS2-3651) BeanUtil class should try and fill the xsi:type attribute with value from type table before defaulting to class name

BeanUtil class should try and fill the xsi:type attribute with value from type table before defaulting to class name
--------------------------------------------------------------------------------------------------------------------

                 Key: AXIS2-3651
                 URL: https://issues.apache.org/jira/browse/AXIS2-3651
             Project: Axis 2.0 (Axis2)
          Issue Type: Improvement
          Components: databinding
    Affects Versions: 1.3, 1.4
         Environment: Windows XP SP2, Java 6
            Reporter: Aaron Gourley
            Priority: Minor


Using the type table to fill the xsi:type attribute would help make it possible to successfully validate SOAP response messages against the WSDL.  Although the class name approach may be sufficient for POJO services, it provides meaningless information when other approaches are used.

I suggest replacing the following lines of BeanUtil.java
             // Added objectAttributes as a fix for issues AXIS2-2055 and AXIS2-1899 to 
            // support polymorphism in POJO approach.
            // For some reason, using QName(Constants.XSI_NAMESPACE, "type", "xsi") does not generate
            // an xsi:type attribtue properly for inner objects. So just using a simple QName("type").
            ArrayList objectAttributes = new ArrayList();
            objectAttributes.add(new QName("type"));
            objectAttributes.add(beanObject.getClass().getName());

With this (or similar ... not sure if qualified check should be there):
            ArrayList objectAttributes = new ArrayList();
            objectAttributes.add(new QName(Constants.XSI_NAMESPACE, "type", "xsi"));
            if( typeTable != null && qualified )
            {
                QName qNamefortheType =
                    typeTable.getQNamefortheType(beanObject.getClass().getName());
                if (qNamefortheType == null) {
                    // Added objectAttributes as a fix for issues AXIS2-2055 and AXIS2-1899 to 
                    // support polymorphism in POJO approach.
                    objectAttributes.add(beanObject.getClass().getName());
                }
                else
                {
                    objectAttributes.add(qNamefortheType);    
                }
            }
            else
            {
                objectAttributes.add(beanObject.getClass().getName());
            }

Note that I had no issues with generating the xsi:type attribute for inner elements in my testing (as was mentioned by the existing comment).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


Re: [jira] Commented: (AXIS2-3651) BeanUtil class should try and fill the xsi:type attribute with value from type table before defaulting to class name

Posted by Nadir Amra <am...@us.ibm.com>.
It is marked as resolved and is in revision 652990....it should be in 
1.4.1 since it was fixed in 02/May/08.  All this information is in the 
issue.  Next time please examine the issue before posting comment. 

Nadir Amra


"Balaji Hari (JIRA)" <ji...@apache.org> wrote on 10/29/2008 09:33:44 AM:

> 
> Balaji Hari commented on AXIS2-3651:
> ------------------------------------
> 
> Where can I get this fix? This has been a blocker issue. Is this 
> integrated in 1.4.1 release?
> 
> > BeanUtil class should try and fill the xsi:type attribute with 
> value from type table before defaulting to class name
> > 
> 
--------------------------------------------------------------------------------------------------------------------
> >
> >                 Key: AXIS2-3651
> >                 URL: https://issues.apache.org/jira/browse/AXIS2-3651
> >             Project: Axis 2.0 (Axis2)
> >          Issue Type: Improvement
> >          Components: databinding
> >    Affects Versions: 1.4, 1.3
> >         Environment: Windows XP SP2, Java 6
> >            Reporter: Aaron Gourley
> >            Assignee: nadir amra
> >            Priority: Minor
> >             Fix For: nightly
> >
> >


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


[jira] Commented: (AXIS2-3651) BeanUtil class should try and fill the xsi:type attribute with value from type table before defaulting to class name

Posted by "nadir amra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3651?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12593365#action_12593365 ] 

nadir amra commented on AXIS2-3651:
-----------------------------------

I agree with Aaron...if there is a problem on the client side then it needs to be fixed on the client side (i.e. open a new JIRA).  Currently the reponse that is returned is not valid and the fix documented here corrects that problem.

> BeanUtil class should try and fill the xsi:type attribute with value from type table before defaulting to class name
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-3651
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3651
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: databinding
>    Affects Versions: 1.4, 1.3
>         Environment: Windows XP SP2, Java 6
>            Reporter: Aaron Gourley
>            Assignee: nadir amra
>            Priority: Minor
>
> Using the type table to fill the xsi:type attribute would help make it possible to successfully validate SOAP response messages against the WSDL.  Although the class name approach may be sufficient for POJO services, it provides meaningless information when other approaches are used.
> I suggest replacing the following lines of BeanUtil.java
>              // Added objectAttributes as a fix for issues AXIS2-2055 and AXIS2-1899 to 
>             // support polymorphism in POJO approach.
>             // For some reason, using QName(Constants.XSI_NAMESPACE, "type", "xsi") does not generate
>             // an xsi:type attribtue properly for inner objects. So just using a simple QName("type").
>             ArrayList objectAttributes = new ArrayList();
>             objectAttributes.add(new QName("type"));
>             objectAttributes.add(beanObject.getClass().getName());
> With this (or similar ... not sure if qualified check should be there):
>             ArrayList objectAttributes = new ArrayList();
>             objectAttributes.add(new QName(Constants.XSI_NAMESPACE, "type", "xsi"));
>             if( typeTable != null && qualified )
>             {
>                 QName qNamefortheType =
>                     typeTable.getQNamefortheType(beanObject.getClass().getName());
>                 if (qNamefortheType == null) {
>                     // Added objectAttributes as a fix for issues AXIS2-2055 and AXIS2-1899 to 
>                     // support polymorphism in POJO approach.
>                     objectAttributes.add(beanObject.getClass().getName());
>                 }
>                 else
>                 {
>                     objectAttributes.add(qNamefortheType);    
>                 }
>             }
>             else
>             {
>                 objectAttributes.add(beanObject.getClass().getName());
>             }
> Note that I had no issues with generating the xsi:type attribute for inner elements in my testing (as was mentioned by the existing comment).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (AXIS2-3651) BeanUtil class should try and fill the xsi:type attribute with value from type table before defaulting to class name

Posted by "Aaron Gourley (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3651?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12593347#action_12593347 ] 

Aaron Gourley commented on AXIS2-3651:
--------------------------------------

It is my feeling that if Datelin is right about this, then it is a problem with the deserialization which in turn needs to be fixed.  It seems clear to me that from a SOAP perspective the xsi:type attribute should be meaningful with regards to the WSDL (i.e. identify the schema type as defined in the WSDL).  In general, the class name doesn't tell a generic SOAP client anything about the elements type, since the class name doesn't appear in the WSDL.

> BeanUtil class should try and fill the xsi:type attribute with value from type table before defaulting to class name
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-3651
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3651
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: databinding
>    Affects Versions: 1.4, 1.3
>         Environment: Windows XP SP2, Java 6
>            Reporter: Aaron Gourley
>            Assignee: nadir amra
>            Priority: Minor
>
> Using the type table to fill the xsi:type attribute would help make it possible to successfully validate SOAP response messages against the WSDL.  Although the class name approach may be sufficient for POJO services, it provides meaningless information when other approaches are used.
> I suggest replacing the following lines of BeanUtil.java
>              // Added objectAttributes as a fix for issues AXIS2-2055 and AXIS2-1899 to 
>             // support polymorphism in POJO approach.
>             // For some reason, using QName(Constants.XSI_NAMESPACE, "type", "xsi") does not generate
>             // an xsi:type attribtue properly for inner objects. So just using a simple QName("type").
>             ArrayList objectAttributes = new ArrayList();
>             objectAttributes.add(new QName("type"));
>             objectAttributes.add(beanObject.getClass().getName());
> With this (or similar ... not sure if qualified check should be there):
>             ArrayList objectAttributes = new ArrayList();
>             objectAttributes.add(new QName(Constants.XSI_NAMESPACE, "type", "xsi"));
>             if( typeTable != null && qualified )
>             {
>                 QName qNamefortheType =
>                     typeTable.getQNamefortheType(beanObject.getClass().getName());
>                 if (qNamefortheType == null) {
>                     // Added objectAttributes as a fix for issues AXIS2-2055 and AXIS2-1899 to 
>                     // support polymorphism in POJO approach.
>                     objectAttributes.add(beanObject.getClass().getName());
>                 }
>                 else
>                 {
>                     objectAttributes.add(qNamefortheType);    
>                 }
>             }
>             else
>             {
>                 objectAttributes.add(beanObject.getClass().getName());
>             }
> Note that I had no issues with generating the xsi:type attribute for inner elements in my testing (as was mentioned by the existing comment).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (AXIS2-3651) BeanUtil class should try and fill the xsi:type attribute with value from type table before defaulting to class name

Posted by "nadir amra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3651?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12592251#action_12592251 ] 

nadir amra commented on AXIS2-3651:
-----------------------------------

This seems like a reasonable fix and I want to do further testing but my initial tests look good.   Anyone have any feedback on this?  Just to summarize, if a simple POJO service such as 

public class WeatherService{
    Weather weather = new Weather();
    
    public void setWeather(Weather weather){
        this.weather = weather;
    }

    public Weather getWeather(){
        return this.weather;
    }
}

was deployed, the SOAP response that would be returned by the Axis 2 engine would be something like the following:

=====================
<getWeatherResponse xmlns:ns="http://service.pojo.sample">
   <ns:return xmlns:ax21="http://data.pojo.sample/xsd"  type="sample.pojo.data.Weather">
  <ax21:forecast>Sunny</ax21:forecast> 
  <ax21:howMuchRain>1.0</ax21:howMuchRain> 
  <ax21:rain>true</ax21:rain> 
  <ax21:temperature>9.5</ax21:temperature> 
  </ns:return>
  </getWeatherResponse>
======================

The above response has 2 problems: 
(1) "type" is missing xsi qualifier and namespace declaration for xsi
(2) "sample.pojo.data.Weather" is used instead of "ax21:Weather"

With the fix the response now looks like the following:
======================
<getWeatherResponse xmlns:ns="http://service.pojo.sample">
  <ns:return xmlns:ax21="http://data.pojo.sample/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ax21:Weather">
  <ax21:forecast>Sunny</ax21:forecast> 
  <ax21:howMuchRain>1.0</ax21:howMuchRain> 
  <ax21:rain>true</ax21:rain> 
  <ax21:temperature>9.5</ax21:temperature> 
  </ns:return>
  </getWeatherResponse>
=======================

I think it would have been beneficial to incude this in 1.4, but oh well...:-(

This fix should also knock some several related JIRAs....

> BeanUtil class should try and fill the xsi:type attribute with value from type table before defaulting to class name
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-3651
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3651
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: databinding
>    Affects Versions: 1.4, 1.3
>         Environment: Windows XP SP2, Java 6
>            Reporter: Aaron Gourley
>            Assignee: nadir amra
>            Priority: Minor
>
> Using the type table to fill the xsi:type attribute would help make it possible to successfully validate SOAP response messages against the WSDL.  Although the class name approach may be sufficient for POJO services, it provides meaningless information when other approaches are used.
> I suggest replacing the following lines of BeanUtil.java
>              // Added objectAttributes as a fix for issues AXIS2-2055 and AXIS2-1899 to 
>             // support polymorphism in POJO approach.
>             // For some reason, using QName(Constants.XSI_NAMESPACE, "type", "xsi") does not generate
>             // an xsi:type attribtue properly for inner objects. So just using a simple QName("type").
>             ArrayList objectAttributes = new ArrayList();
>             objectAttributes.add(new QName("type"));
>             objectAttributes.add(beanObject.getClass().getName());
> With this (or similar ... not sure if qualified check should be there):
>             ArrayList objectAttributes = new ArrayList();
>             objectAttributes.add(new QName(Constants.XSI_NAMESPACE, "type", "xsi"));
>             if( typeTable != null && qualified )
>             {
>                 QName qNamefortheType =
>                     typeTable.getQNamefortheType(beanObject.getClass().getName());
>                 if (qNamefortheType == null) {
>                     // Added objectAttributes as a fix for issues AXIS2-2055 and AXIS2-1899 to 
>                     // support polymorphism in POJO approach.
>                     objectAttributes.add(beanObject.getClass().getName());
>                 }
>                 else
>                 {
>                     objectAttributes.add(qNamefortheType);    
>                 }
>             }
>             else
>             {
>                 objectAttributes.add(beanObject.getClass().getName());
>             }
> Note that I had no issues with generating the xsi:type attribute for inner elements in my testing (as was mentioned by the existing comment).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (AXIS2-3651) BeanUtil class should try and fill the xsi:type attribute with value from type table before defaulting to class name

Posted by "Detelin Yordanov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3651?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12593315#action_12593315 ] 

Detelin Yordanov commented on AXIS2-3651:
-----------------------------------------

Hello guys,
  I'm not sure that I am correct about this but I think there might be a problem with this.

Suppose we have a service operation that returns the response above. What will happen if this service is invoked with the 
RPCServiceClient, e.g.
        RPCServiceClient sender = getRPCClient("WeatherService", "getWeather");
        OMElement response = sender.invokeBlocking(new QName("http://service.pojo.sample", "getWeather", "req"), new Object[]{});
        Weather weather = (Weather)BeanUtil.deserialize(Weather.class, response.getFirstElement(), new DefaultObjectSupplier(), null);

The BeanUtil.deserialize(..) currently checks for "type" attribute and assumes that if present it will contain the Java class name, not the schema
name of the type.
If you switch to xsi:type containing e.g. "ax21:Weather" (in the case when the type table on the server side is not null),
then the BeanUtil.deserialize(..) will fail since it will not have the type table (it's being called on the client side) and could not find
the Java class mapping for the "ax21:Weather".

I've taken the example above from the org.apache.axis2.rpc.RPCCallTest from the axis2-integration module.

Regards,
   Detelin

> BeanUtil class should try and fill the xsi:type attribute with value from type table before defaulting to class name
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-3651
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3651
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: databinding
>    Affects Versions: 1.4, 1.3
>         Environment: Windows XP SP2, Java 6
>            Reporter: Aaron Gourley
>            Assignee: nadir amra
>            Priority: Minor
>
> Using the type table to fill the xsi:type attribute would help make it possible to successfully validate SOAP response messages against the WSDL.  Although the class name approach may be sufficient for POJO services, it provides meaningless information when other approaches are used.
> I suggest replacing the following lines of BeanUtil.java
>              // Added objectAttributes as a fix for issues AXIS2-2055 and AXIS2-1899 to 
>             // support polymorphism in POJO approach.
>             // For some reason, using QName(Constants.XSI_NAMESPACE, "type", "xsi") does not generate
>             // an xsi:type attribtue properly for inner objects. So just using a simple QName("type").
>             ArrayList objectAttributes = new ArrayList();
>             objectAttributes.add(new QName("type"));
>             objectAttributes.add(beanObject.getClass().getName());
> With this (or similar ... not sure if qualified check should be there):
>             ArrayList objectAttributes = new ArrayList();
>             objectAttributes.add(new QName(Constants.XSI_NAMESPACE, "type", "xsi"));
>             if( typeTable != null && qualified )
>             {
>                 QName qNamefortheType =
>                     typeTable.getQNamefortheType(beanObject.getClass().getName());
>                 if (qNamefortheType == null) {
>                     // Added objectAttributes as a fix for issues AXIS2-2055 and AXIS2-1899 to 
>                     // support polymorphism in POJO approach.
>                     objectAttributes.add(beanObject.getClass().getName());
>                 }
>                 else
>                 {
>                     objectAttributes.add(qNamefortheType);    
>                 }
>             }
>             else
>             {
>                 objectAttributes.add(beanObject.getClass().getName());
>             }
> Note that I had no issues with generating the xsi:type attribute for inner elements in my testing (as was mentioned by the existing comment).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Assigned: (AXIS2-3651) BeanUtil class should try and fill the xsi:type attribute with value from type table before defaulting to class name

Posted by "nadir amra (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-3651?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

nadir amra reassigned AXIS2-3651:
---------------------------------

    Assignee: nadir amra

> BeanUtil class should try and fill the xsi:type attribute with value from type table before defaulting to class name
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-3651
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3651
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: databinding
>    Affects Versions: 1.4, 1.3
>         Environment: Windows XP SP2, Java 6
>            Reporter: Aaron Gourley
>            Assignee: nadir amra
>            Priority: Minor
>
> Using the type table to fill the xsi:type attribute would help make it possible to successfully validate SOAP response messages against the WSDL.  Although the class name approach may be sufficient for POJO services, it provides meaningless information when other approaches are used.
> I suggest replacing the following lines of BeanUtil.java
>              // Added objectAttributes as a fix for issues AXIS2-2055 and AXIS2-1899 to 
>             // support polymorphism in POJO approach.
>             // For some reason, using QName(Constants.XSI_NAMESPACE, "type", "xsi") does not generate
>             // an xsi:type attribtue properly for inner objects. So just using a simple QName("type").
>             ArrayList objectAttributes = new ArrayList();
>             objectAttributes.add(new QName("type"));
>             objectAttributes.add(beanObject.getClass().getName());
> With this (or similar ... not sure if qualified check should be there):
>             ArrayList objectAttributes = new ArrayList();
>             objectAttributes.add(new QName(Constants.XSI_NAMESPACE, "type", "xsi"));
>             if( typeTable != null && qualified )
>             {
>                 QName qNamefortheType =
>                     typeTable.getQNamefortheType(beanObject.getClass().getName());
>                 if (qNamefortheType == null) {
>                     // Added objectAttributes as a fix for issues AXIS2-2055 and AXIS2-1899 to 
>                     // support polymorphism in POJO approach.
>                     objectAttributes.add(beanObject.getClass().getName());
>                 }
>                 else
>                 {
>                     objectAttributes.add(qNamefortheType);    
>                 }
>             }
>             else
>             {
>                 objectAttributes.add(beanObject.getClass().getName());
>             }
> Note that I had no issues with generating the xsi:type attribute for inner elements in my testing (as was mentioned by the existing comment).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (AXIS2-3651) BeanUtil class should try and fill the xsi:type attribute with value from type table before defaulting to class name

Posted by "Balaji Hari (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3651?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12643497#action_12643497 ] 

Balaji Hari commented on AXIS2-3651:
------------------------------------

Where can I get this fix? This has been a blocker issue. Is this integrated in 1.4.1 release?

> BeanUtil class should try and fill the xsi:type attribute with value from type table before defaulting to class name
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-3651
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3651
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: databinding
>    Affects Versions: 1.4, 1.3
>         Environment: Windows XP SP2, Java 6
>            Reporter: Aaron Gourley
>            Assignee: nadir amra
>            Priority: Minor
>             Fix For: nightly
>
>
> Using the type table to fill the xsi:type attribute would help make it possible to successfully validate SOAP response messages against the WSDL.  Although the class name approach may be sufficient for POJO services, it provides meaningless information when other approaches are used.
> I suggest replacing the following lines of BeanUtil.java
>              // Added objectAttributes as a fix for issues AXIS2-2055 and AXIS2-1899 to 
>             // support polymorphism in POJO approach.
>             // For some reason, using QName(Constants.XSI_NAMESPACE, "type", "xsi") does not generate
>             // an xsi:type attribtue properly for inner objects. So just using a simple QName("type").
>             ArrayList objectAttributes = new ArrayList();
>             objectAttributes.add(new QName("type"));
>             objectAttributes.add(beanObject.getClass().getName());
> With this (or similar ... not sure if qualified check should be there):
>             ArrayList objectAttributes = new ArrayList();
>             objectAttributes.add(new QName(Constants.XSI_NAMESPACE, "type", "xsi"));
>             if( typeTable != null && qualified )
>             {
>                 QName qNamefortheType =
>                     typeTable.getQNamefortheType(beanObject.getClass().getName());
>                 if (qNamefortheType == null) {
>                     // Added objectAttributes as a fix for issues AXIS2-2055 and AXIS2-1899 to 
>                     // support polymorphism in POJO approach.
>                     objectAttributes.add(beanObject.getClass().getName());
>                 }
>                 else
>                 {
>                     objectAttributes.add(qNamefortheType);    
>                 }
>             }
>             else
>             {
>                 objectAttributes.add(beanObject.getClass().getName());
>             }
> Note that I had no issues with generating the xsi:type attribute for inner elements in my testing (as was mentioned by the existing comment).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Resolved: (AXIS2-3651) BeanUtil class should try and fill the xsi:type attribute with value from type table before defaulting to class name

Posted by "nadir amra (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-3651?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

nadir amra resolved AXIS2-3651.
-------------------------------

       Resolution: Fixed
    Fix Version/s: nightly

Fixed in committed revision 652990

> BeanUtil class should try and fill the xsi:type attribute with value from type table before defaulting to class name
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-3651
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3651
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: databinding
>    Affects Versions: 1.4, 1.3
>         Environment: Windows XP SP2, Java 6
>            Reporter: Aaron Gourley
>            Assignee: nadir amra
>            Priority: Minor
>             Fix For: nightly
>
>
> Using the type table to fill the xsi:type attribute would help make it possible to successfully validate SOAP response messages against the WSDL.  Although the class name approach may be sufficient for POJO services, it provides meaningless information when other approaches are used.
> I suggest replacing the following lines of BeanUtil.java
>              // Added objectAttributes as a fix for issues AXIS2-2055 and AXIS2-1899 to 
>             // support polymorphism in POJO approach.
>             // For some reason, using QName(Constants.XSI_NAMESPACE, "type", "xsi") does not generate
>             // an xsi:type attribtue properly for inner objects. So just using a simple QName("type").
>             ArrayList objectAttributes = new ArrayList();
>             objectAttributes.add(new QName("type"));
>             objectAttributes.add(beanObject.getClass().getName());
> With this (or similar ... not sure if qualified check should be there):
>             ArrayList objectAttributes = new ArrayList();
>             objectAttributes.add(new QName(Constants.XSI_NAMESPACE, "type", "xsi"));
>             if( typeTable != null && qualified )
>             {
>                 QName qNamefortheType =
>                     typeTable.getQNamefortheType(beanObject.getClass().getName());
>                 if (qNamefortheType == null) {
>                     // Added objectAttributes as a fix for issues AXIS2-2055 and AXIS2-1899 to 
>                     // support polymorphism in POJO approach.
>                     objectAttributes.add(beanObject.getClass().getName());
>                 }
>                 else
>                 {
>                     objectAttributes.add(qNamefortheType);    
>                 }
>             }
>             else
>             {
>                 objectAttributes.add(beanObject.getClass().getName());
>             }
> Note that I had no issues with generating the xsi:type attribute for inner elements in my testing (as was mentioned by the existing comment).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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