Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-5482

getOMElement fails to properly set the counts on null/nil items

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.6.2
    • None
    • adb

    Description

      When there is a series of null/nil arguments in a call, getOMElement fails to increase the item count when it should leading to an "invalid value ... for " Fault on the server side.

      The fix is pretty simple : add ++argCount before the continue int the arg == null test in getOMElement (see patch).

      Example without the patch, the 4 item 1 are in fact 4 different arguments !

      <getAudits xmlns="http://soap.entelience.com">
      <arg0 xmlns="">false</arg0>
      <item1 xmlns="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />
      <item1 xmlns="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />
      <item1 xmlns="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />
      <item1 xmlns="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />
      <arg1 xmlns="">false</arg1>
      <arg2 xmlns="">reference</arg2>
      <arg3 xmlns="">desc</arg3>
      <arg4 xmlns="">1</arg4></getAudits>

      With the fix, it's all clean

      <getAudits xmlns="http://soap.entelience.com">
      <arg0 xmlns="">false</arg0>
      <item1 xmlns="">3</item1><item1 xmlns="">4</item1>
      <item2 xmlns="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />
      <item3 xmlns="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />
      <item4 xmlns="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />
      <arg5 xmlns="">false</arg5>
      <arg6 xmlns="">origin</arg6>
      <arg7 xmlns="">asc</arg7>
      <arg8 xmlns="">1</arg8>
      </getAudits>

      Patch is attached

      — BeanUtil.java.orig 2013-02-01 13:01:30.000000000 +0100
      +++ BeanUtil.java 2013-02-01 13:01:50.000000000 +0100
      @@ -838,6 +838,7 @@
      objects.add(partName);
      }
      objects.add(arg);
      + ++argCount;
      continue;
      }

      Attachments

        1. patch2.diff
          0.3 kB
          Philippe Le Berre

        Activity

          People

            kishanthan Kishanthan Thangarajah
            pleberre Philippe Le Berre
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: