TypeMapping tm = (TypeMapping) reg.createTypeMapping();
tm.setSupportedEncodings(new String[] {Constants.URI_DEFAULT_SOAP_ENC});
reg.register(Constants.URI_DEFAULT_SOAP_ENC, tm);
QName dataQName = new QName("typeNS", "Data");
tm.register(Data.class, dataQName, new DataSerFactory(), new DataDeserFactory());
msg.output(context);
String msgString = stringWriter.toString();