You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Thad Humphries <th...@mindwrap.com> on 2005/08/13 00:41:51 UTC

ArrayDeserializerFactory constructor oversight?

I've been playing with a (de)serializer for a class that contains an array 
member.  My serializer worked fine--I registered the serializer for the class 
in the array with 

  TypeMappingRegistry reg = context.getTypeMappingRegistry();
  TypeMapping tm = (TypeMapping)   
       reg.getOrMakeTypeMapping(Constants.URI_SOAP11_ENC);
  tm.register( ACLRec.class, OASQNames.aclRecQName,
       new ArraySerializerFactory(ACLRec.class, OASQNames.aclRecQName),        
       new ArrayDeserializerFactory(OASQNames.aclRecQName));

And TCP Monitor showed a good soapenv:Envelope coming back but my 
deserializer's onStartChild() failed to deserialize.  Eventually, I figured 
out to register deserialization as

  TypeMappingRegistry reg = context.getTypeMappingRegistry();
  TypeMapping tm = (TypeMapping)   
       reg.getOrMakeTypeMapping(Constants.URI_SOAP11_ENC);
  tm.register( ACLRec.class, OASQNames.aclRecQName, 
       new ACLRecSerFactory(), new ACLRecDeserFactory() );
  tm.register( ACLRec[].class, OASQNames.aclRecArrQName,
       new ArraySerializerFactory(ACLRec.class, OASQNames.aclRecQName),        
       new ArrayDeserializerFactory(OASQNames.aclRecQName));

I believe this is because ArrayDeserializerFactory initializes only with a 
QName, not a class and QName.  Why not?  Is that an oversight in the API?

Interstingly, I can use the same registration in my serializer but the 
soapenv:Envelope is the same either way.

In any case, it's something else to add to the write-up for the User's Manual 
that I am planning.