Issue Details (XML | Word | Printable)

Key: AXIS-2417
Type: Bug Bug
Status: Open Open
Priority: Blocker Blocker
Assignee: Unassigned
Reporter: Martin Genhart
Votes: 1
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Axis

Deserialization fails if your schema defines arrays within arrays.

Created: 22/Feb/06 10:28 PM   Updated: 15/Apr/06 10:20 AM
Return to search
Component/s: Serialization/Deserialization
Affects Version/s: 1.3
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments:
  Size
Java Source File Licensed for inclusion in ASF works ArrayDeserializer.java 2006-04-15 10:15 AM Ross Mills 31 kB
Java Source File Licensed for inclusion in ASF works BeanPropertyDescriptor.java 2006-04-15 10:16 AM Ross Mills 9 kB
Java Source File Licensed for inclusion in ASF works DeserializationContext.java 2006-02-22 10:33 PM Martin Genhart 42 kB
XML File Licensed for inclusion in ASF works systemServices.xsd 2006-02-22 10:31 PM Martin Genhart 16 kB
Environment: Windows XP / Java 1.5


 Description  « Hide
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.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no subversion log entries for this issue yet.