RPCElement body = new RPCElement("urn:myNamespace", "method1", new Object[]{ arg });
msg.addBodyElement(body);
body.setEncodingStyle(null);
Writer stringWriter = new StringWriter();
SerializationContext context = new SerializationContextImpl(stringWriter, msgContext);
context.setDoMultiRefs(false); // no multirefs
context.setPretty(false);
// Create a TypeMapping and register the Bean serializer/deserializer
TypeMappingRegistry reg = context.getTypeMappingRegistry();
TypeMapping tm = (TypeMapping) reg.createTypeMapping();
// The "" namespace is literal (no encoding).
tm.setSupportedEncodings(new String[] {Constants.URI_DEFAULT_SOAP_ENC});
reg.register(Constants.URI_DEFAULT_SOAP_ENC, tm);