SerializationContext context = new SerializationContextImpl(stringWriter, msgContext);
context.setDoMultiRefs(multiref);
// Create a TypeMapping and register the specialized Type Mapping
TypeMappingRegistry reg = context.getTypeMappingRegistry();
TypeMapping tm = (TypeMapping) reg.createTypeMapping();
tm.setSupportedNamespaces(new String[] {Constants.URI_CURRENT_SOAP_ENC});
reg.register(Constants.URI_CURRENT_SOAP_ENC, tm);
QName dataQName = new QName("typeNS", "Data");
tm.register(Data.class, dataQName, new DataSerFactory(), new DataDeserFactory());