RPCParam arg2 = new RPCParam("", "struct", data);
RPCElement body = new RPCElement("urn:myNamespace", "method1", new Object[]{ arg1, arg2 });
msg.addBodyElement(body);
Writer stringWriter = new StringWriter();
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.setSupportedEncodings(new String[] {Constants.URI_SOAP12_ENC});
reg.register(Constants.URI_SOAP12_ENC, tm);
QName dataQName = new QName("typeNS", "Data");