[ http://issues.apache.org/jira/browse/AXIS-2417?page=comments#action_12374597 ]
Ross Mills commented on AXIS-2417: ---------------------------------- I was able to make changes to the code that fixed this problem for me. The change was actually pretty small. The updated code has been attached. > Deserialization fails if your schema defines arrays within arrays. > ------------------------------------------------------------------ > > Key: AXIS-2417 > URL: http://issues.apache.org/jira/browse/AXIS-2417 > Project: Apache Axis > Type: Bug > Components: Serialization/Deserialization > Versions: 1.3 > Environment: Windows XP / Java 1.5 > Reporter: Martin Genhart > Priority: Blocker > Attachments: ArrayDeserializer.java, BeanPropertyDescriptor.java, > DeserializationContext.java, systemServices.xsd > > 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. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
