MessageFactory mf = (MessageFactory)
FactoryRegistry.getFactory(MessageFactory.class);
Message m = mf.create(Protocol.soap11);
// Get the BlockFactory
XMLStringBlockFactory f = (XMLStringBlockFactory)
FactoryRegistry.getFactory(XMLStringBlockFactory.class);
// Sample text is whitespace. There is no element
String whiteSpaceText = "<!-- Comment -->";
// Create a Block using the sample string as the content. This simulates
// what occurs on the outbound JAX-WS dispatch<String> client
Block block = f.createFrom(whiteSpaceText, null, null);
// Add the block to the message as normal body content.
m.setBodyBlock(block);
// If there is a JAX-WS handler, the Message is converted into a SOAPEnvelope