Details
-
Bug
-
Status: Open
-
Blocker
-
Resolution: Unresolved
-
1.3
-
None
-
None
-
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)
+++
+++ }
+++ }
+++ }
+++ 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)
}
}
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.