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 "Detelin Yordanov (JIRA)" <ji...@apache.org> on 2008/08/18 17:54:45 UTC

[jira] Created: (AXIS2-3974) BeanUtil.deserialize does not handle xsi:nil attribute properly

BeanUtil.deserialize does not handle xsi:nil attribute properly
---------------------------------------------------------------

                 Key: AXIS2-3974
                 URL: https://issues.apache.org/jira/browse/AXIS2-3974
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: adb
    Affects Versions: nightly
         Environment: Axis2 Trunk with experimental multidimensional array support (thanks to Amila)
            Reporter: Detelin Yordanov


The BeanUtil.deserialize(Class, OMElement, ObjectSupplier, String) in Adb module does not handle xsi:nil attributes on array elements properly.

In the given example test case a 2D string array (that is part of a POJO) is being sent to an Echo Java service.
The 2D array contains an null array and a null array element:
String[][] stringArray2D = new String[][] { new String[] { "axis2", null}, null}

The request is send using ADB client stub and it's OK:
<ns2:echoSimplePOJO xmlns:ns2="http://test.tempuri.org">
    <ns2:simplePOJO>
         <names xmlns="http://test.tempuri.org/xsd">
             <names>axis2</names>
             <names xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="1" />
          </names>
          <ns1:names xmlns:ns1="http://test.tempuri.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="1" />
</ns2:simplePOJO>

The request, however, contains an empty string rather than a null string, and does not contain the null array:

<ns:return xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ax23="http://test.tempuri.org/xsd" xsi:type="ax23:SimplePOJO">
    <ax23:names>
         <ax23:names>axis2</ax23:names>
         <ax23:names></ax23:names>
    </ax23:names>
</ns:return>

The problem is that the deserialize(..) method does not check for xsi:nil.
Additionally it does not put deserialized null array elements inside the valueList, so they are effectively skipped.

-- 
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] Updated: (AXIS2-3974) BeanUtil.deserialize does not handle xsi:nil attribute properly

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

Detelin Yordanov updated AXIS2-3974:
------------------------------------

    Attachment: NullArrayTest.zip

A test project that contains a test service, and Adb client and JUnit test that uses it.
The web service aar is build with Ant, make sure to set the correct Axis2 snapshot lib folder in the build/build.properties as well as the Eclipse build path.

> BeanUtil.deserialize does not handle xsi:nil attribute properly
> ---------------------------------------------------------------
>
>                 Key: AXIS2-3974
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3974
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: nightly
>         Environment: Axis2 Trunk with experimental multidimensional array support (thanks to Amila)
>            Reporter: Detelin Yordanov
>         Attachments: NullArrayTest.zip
>
>
> The BeanUtil.deserialize(Class, OMElement, ObjectSupplier, String) in Adb module does not handle xsi:nil attributes on array elements properly.
> In the given example test case a 2D string array (that is part of a POJO) is being sent to an Echo Java service.
> The 2D array contains an null array and a null array element:
> String[][] stringArray2D = new String[][] { new String[] { "axis2", null}, null}
> The request is send using ADB client stub and it's OK:
> <ns2:echoSimplePOJO xmlns:ns2="http://test.tempuri.org">
>     <ns2:simplePOJO>
>          <names xmlns="http://test.tempuri.org/xsd">
>              <names>axis2</names>
>              <names xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="1" />
>           </names>
>           <ns1:names xmlns:ns1="http://test.tempuri.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="1" />
> </ns2:simplePOJO>
> The request, however, contains an empty string rather than a null string, and does not contain the null array:
> <ns:return xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ax23="http://test.tempuri.org/xsd" xsi:type="ax23:SimplePOJO">
>     <ax23:names>
>          <ax23:names>axis2</ax23:names>
>          <ax23:names></ax23:names>
>     </ax23:names>
> </ns:return>
> The problem is that the deserialize(..) method does not check for xsi:nil.
> Additionally it does not put deserialized null array elements inside the valueList, so they are effectively skipped.

-- 
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-3974) BeanUtil.deserialize does not handle xsi:nil attribute properly

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

Nandana Mihindukulasooriya resolved AXIS2-3974.
-----------------------------------------------

    Resolution: Fixed

Applied Detelin's patch with some minor changes in revision 688008. 
Thanks Detelin. 

> BeanUtil.deserialize does not handle xsi:nil attribute properly
> ---------------------------------------------------------------
>
>                 Key: AXIS2-3974
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3974
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: nightly
>         Environment: Axis2 Trunk with experimental multidimensional array support (thanks to Amila)
>            Reporter: Detelin Yordanov
>         Attachments: BeanUtil_patch.txt, HTTP_log.txt, NullArrayTest.zip
>
>
> The BeanUtil.deserialize(Class, OMElement, ObjectSupplier, String) in Adb module does not handle xsi:nil attributes on array elements properly.
> In the given example test case a 2D string array (that is part of a POJO) is being sent to an Echo Java service.
> The 2D array contains an null array and a null array element:
> String[][] stringArray2D = new String[][] { new String[] { "axis2", null}, null}
> The request is send using ADB client stub and it's OK:
> <ns2:echoSimplePOJO xmlns:ns2="http://test.tempuri.org">
>     <ns2:simplePOJO>
>          <names xmlns="http://test.tempuri.org/xsd">
>              <names>axis2</names>
>              <names xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="1" />
>           </names>
>           <ns1:names xmlns:ns1="http://test.tempuri.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="1" />
> </ns2:simplePOJO>
> The request, however, contains an empty string rather than a null string, and does not contain the null array:
> <ns:return xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ax23="http://test.tempuri.org/xsd" xsi:type="ax23:SimplePOJO">
>     <ax23:names>
>          <ax23:names>axis2</ax23:names>
>          <ax23:names></ax23:names>
>     </ax23:names>
> </ns:return>
> The problem is that the deserialize(..) method does not check for xsi:nil.
> Additionally it does not put deserialized null array elements inside the valueList, so they are effectively skipped.

-- 
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] Updated: (AXIS2-3974) BeanUtil.deserialize does not handle xsi:nil attribute properly

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

Detelin Yordanov updated AXIS2-3974:
------------------------------------

    Attachment: HTTP_log.txt

The http request and response.

> BeanUtil.deserialize does not handle xsi:nil attribute properly
> ---------------------------------------------------------------
>
>                 Key: AXIS2-3974
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3974
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: nightly
>         Environment: Axis2 Trunk with experimental multidimensional array support (thanks to Amila)
>            Reporter: Detelin Yordanov
>         Attachments: BeanUtil_patch.txt, HTTP_log.txt, NullArrayTest.zip
>
>
> The BeanUtil.deserialize(Class, OMElement, ObjectSupplier, String) in Adb module does not handle xsi:nil attributes on array elements properly.
> In the given example test case a 2D string array (that is part of a POJO) is being sent to an Echo Java service.
> The 2D array contains an null array and a null array element:
> String[][] stringArray2D = new String[][] { new String[] { "axis2", null}, null}
> The request is send using ADB client stub and it's OK:
> <ns2:echoSimplePOJO xmlns:ns2="http://test.tempuri.org">
>     <ns2:simplePOJO>
>          <names xmlns="http://test.tempuri.org/xsd">
>              <names>axis2</names>
>              <names xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="1" />
>           </names>
>           <ns1:names xmlns:ns1="http://test.tempuri.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="1" />
> </ns2:simplePOJO>
> The request, however, contains an empty string rather than a null string, and does not contain the null array:
> <ns:return xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ax23="http://test.tempuri.org/xsd" xsi:type="ax23:SimplePOJO">
>     <ax23:names>
>          <ax23:names>axis2</ax23:names>
>          <ax23:names></ax23:names>
>     </ax23:names>
> </ns:return>
> The problem is that the deserialize(..) method does not check for xsi:nil.
> Additionally it does not put deserialized null array elements inside the valueList, so they are effectively skipped.

-- 
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] Updated: (AXIS2-3974) BeanUtil.deserialize does not handle xsi:nil attribute properly

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

Detelin Yordanov updated AXIS2-3974:
------------------------------------

    Attachment: BeanUtil_patch.txt

The suggested patch.

> BeanUtil.deserialize does not handle xsi:nil attribute properly
> ---------------------------------------------------------------
>
>                 Key: AXIS2-3974
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3974
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: nightly
>         Environment: Axis2 Trunk with experimental multidimensional array support (thanks to Amila)
>            Reporter: Detelin Yordanov
>         Attachments: BeanUtil_patch.txt, HTTP_log.txt, NullArrayTest.zip
>
>
> The BeanUtil.deserialize(Class, OMElement, ObjectSupplier, String) in Adb module does not handle xsi:nil attributes on array elements properly.
> In the given example test case a 2D string array (that is part of a POJO) is being sent to an Echo Java service.
> The 2D array contains an null array and a null array element:
> String[][] stringArray2D = new String[][] { new String[] { "axis2", null}, null}
> The request is send using ADB client stub and it's OK:
> <ns2:echoSimplePOJO xmlns:ns2="http://test.tempuri.org">
>     <ns2:simplePOJO>
>          <names xmlns="http://test.tempuri.org/xsd">
>              <names>axis2</names>
>              <names xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="1" />
>           </names>
>           <ns1:names xmlns:ns1="http://test.tempuri.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="1" />
> </ns2:simplePOJO>
> The request, however, contains an empty string rather than a null string, and does not contain the null array:
> <ns:return xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ax23="http://test.tempuri.org/xsd" xsi:type="ax23:SimplePOJO">
>     <ax23:names>
>          <ax23:names>axis2</ax23:names>
>          <ax23:names></ax23:names>
>     </ax23:names>
> </ns:return>
> The problem is that the deserialize(..) method does not check for xsi:nil.
> Additionally it does not put deserialized null array elements inside the valueList, so they are effectively skipped.

-- 
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