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

BeanUtil.deserialize() tries to deserialize the wrong OMNode for byte[]

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.3
    • None
    • adb
    • None
    • Axis2/Tomcat 6 Serverside; C#.net on client side

    Description

      BeanUtil decodes the wrong node for byte[] which are part of a complex type contained in a sequence due to a bug in
      deserialize(Class beanClass,
      OMElement beanElement,
      ObjectSupplier objectSupplier,
      String arrayLocalName) :

      BeanUtil class lines 381-383 do not take byte arrays into account:

      } else if (parameters.isArray())

      { partObj = deserialize(parameters, (OMElement)parts.getParent(), objectSupplier, prty.getName()); }

      ...
      so that line 308 tries to decode the text of the parent node.

      if ("byte".equals(arrayClassType.getName()))

      { return Base64.decode(beanElement.getFirstElement().getText()); }

      else

      { The following patch to lines 381-383 performs the recursive call with the correct node for byte arrays. }

      else if (parameters.isArray()) {
      if ("byte".equals(parameters.getComponentType().getName()))

      { partObj = deserialize(parameters, (OMElement) parts, objectSupplier, prty.getName()); }

      else

      { partObj = deserialize(parameters, (OMElement)parts.getParent(), objectSupplier, prty.getName()); }

      } ...
      Additionally Base64.decode(beanElement.getFirstElement().getText()) must be replaced with Base64.decode(beanElement.getText())

      I'll attach my WSDL which was generated from my POJOs.

      Attachments

        1. CountAbos.wsdl
          8 kB
          Sven Blösl

        Activity

          People

            deepal Deepal Jayasinghe
            sbloesl Sven Blösl
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: