Axis
  1. Axis
  2. AXIS-2417

Deserialization fails if your schema defines arrays within arrays.

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Blocker Blocker
    • Resolution: Unresolved
    • Affects Version/s: 1.3
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Windows XP / Java 1.5

      Description

      See the element PSWorkflow of the attached schema as an example. If you define subcomponents as arrays and these subcomponents specify an attribute named "id", array deserialization may fail because the deserialization context registers fixups based on the ids (prependend by #). If like in the supplied example multiple arrays and array comonents define an "id" and the id of different components is the same, deserialization may fail because the fixups are only mapped by the "#id".

      The fixups should instead be mapped by a fully qualified name. In the fix that I supplied I use the ArrayClass from the registered deserializer as qualifier. See org.apache.axis.encoding.DeserializationContext.registerFixup(String, Deserializer):

      public void registerFixup(String href, Deserializer dser)
      {
      if (fixups == null)
      fixups = new HashMap();

      +++ String qualifier = "";
      +++ Vector targets = dser.getValueTargets();
      +++ if (targets != null && !targets.isEmpty())
      +++ {
      +++ if (targets.get(0) instanceof DeserializerTarget)
      +++ {
      +++ DeserializerTarget target = (DeserializerTarget) targets.get(0);
      +++ if (target != null && target.target instanceof ArrayDeserializer)
      +++ {
      +++ ArrayDeserializer arrayDser = (ArrayDeserializer) target.target;
      +++ ArrayDeserializer.ArrayListExtension listExtension =
      +++ (ArrayDeserializer.ArrayListExtension) arrayDser.getValue();
      +++ if (listExtension != null)
      +++

      { +++ Class destClass = listExtension.getDestClass(); +++ if (destClass != null) +++ qualifier = "-" + destClass.getName(); +++ }

      +++ }
      +++ }
      +++ }

      +++ Deserializer prev = (Deserializer) fixups.put(href + qualifier, dser);

      // There could already be a deserializer in the fixup list
      // for this href. If so, the easiest way to get all of the
      // targets updated is to move the previous deserializers
      // targets to dser.
      if (prev != null && prev != dser) {
      dser.moveValueTargets(prev);
      if (dser.getDefaultType() == null)

      { dser.setDefaultType(prev.getDefaultType()); }

      }
      }

      While debugging this problem, I noticed that you do that same thing for attachement references. I would assume that that code will have the same issue.

      I noted that you use the attributes "id" and "href" for attachements and fixups. Does this mean that attributes with these names are reserved for Axis? I have not found any documentation regarding my question.

      1. systemServices.xsd
        16 kB
        Martin Genhart
      2. DeserializationContext.java
        42 kB
        Martin Genhart
      3. BeanPropertyDescriptor.java
        9 kB
        Ross Mills
      4. ArrayDeserializer.java
        31 kB
        Ross Mills

        Activity

        Martin Genhart created issue -
        Martin Genhart made changes -
        Field Original Value New Value
        Attachment systemServices.xsd [ 12323267 ]
        Martin Genhart made changes -
        Attachment DeserializationContext.java [ 12323268 ]
        Ross Mills made changes -
        Attachment ArrayDeserializer.java [ 12325365 ]
        Ross Mills made changes -
        Attachment BeanPropertyDescriptor.java [ 12325366 ]
        Mark Thomas made changes -
        Workflow jira [ 12348549 ] Default workflow, editable Closed status [ 12554736 ]
        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12554736 ] jira [ 12577962 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Martin Genhart
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development