RPCElement body = new RPCElement("urn:myNamespace", "method1", new Object[] { arg1 });
msg.addBodyElement(body);
body.setEncodingStyle(Constants.URI_LITERAL_ENC);
SerializationContext context = new SerializationContextImpl(stringWriter, msgContext);
msg.output(context);
msgString = stringWriter.toString();
// Now reparse into DOM so we can check namespaces.
StringReader resReader = new StringReader(msgString);