Hi,
I am trying to create a serializer/desrializer for a complex type. Here is
the code I am using. I got this code from this mailing list, being posted by
Arun.
QName doubleArrayTypeQname = new QName("", "double");
QName complexQname = new QName("
http://tempuri.org/", "StatisticStruct");
CombinedSerializer doubleSerializer = new
SimpleTypeSerializer(SchemaConstants.QNAME_TYPE_DOUBLE, DONT_ENCODE_TYPE,
NULLABLE, SOAPConstants.URI_NS_SOAP_ENCODING,
XSDDoubleEncoder.getInstance());
CombinedSerializer doubleArraySerializer = new
SimpleTypeArraySerializer(doubleArrayTypeQname, ENCODE_TYPE, NULLABLE,
SOAPConstants.URI_NS_SOAP_ENCODING, null, SchemaConstants.QNAME_TYPE_DOUBLE,
double.class, 1, null, (SimpleTypeSerializer)doubleSerializer);
doubleArraySerializer = new ReferenceableSerializerImpl(SERIALIZE_AS_REF,
doubleArraySerializer);
SerializerFactory doubleArraySerializerFactory = new
SingletonSerializerFactory(doubleArraySerializer);
DeserializerFactory doubleArrayDeserializerFactory = new
SingletonDeserializerFactory(doubleArraySerializer);
Service service = factory.createService(new QName(qnameService));
QName port = new QName("
http://tempuri.org/", qnamePort);
TypeMappingRegistry registry = service.getTypeMappingRegistry();
TypeMapping typeMapping =
registry.getTypeMapping(SOAPConstants.URI_NS_SOAP_ENCODING);
typeMapping.register(double[].class, doubleArrayTypeQname,
doubleArraySerializerFactory, doubleArrayDeserializerFactory);
CombinedSerializer complexSerializer = new
Complex_SOAPSerializer(complexQname, ENCODE_TYPE, NULLABLE,
SOAPConstants.URI_NS_SOAP_ENCODING);
complexSerializer = new ReferenceableSerializerImpl(SERIALIZE_AS_REF,
complexSerializer);
SerializerFactory complexSerializerFactory = new
SingletonSerializerFactory(complexSerializer);
DeserializerFactory complexDeserializerFactory = new
SingletonDeserializerFactory(complexSerializer);
typeMapping.register(StatisticStruct.class, complexQname,
complexSerializerFactory, complexDeserializerFactory);
But I am not able to find the "Complex_SOAPSerializer" class in any of the
jars(I thought I might be in jaxrpc-ri.jar). Where can I find this class? Or
should I create this class?
Thanks
Sudhir