+ " <tns:echoString xmlns:tns='http://org.jboss.ws/2004'>" + " <string>Hello World!</string>" + " </tns:echoString>" + " </env:Body>"
+ "</env:Envelope>";
ByteArrayInputStream inputStream = new ByteArrayInputStream(envStr.getBytes());
MessageFactory factory = new MessageFactoryImpl();
SOAPMessage soapMsg = factory.createMessage(null, inputStream);
SOAPEnvelope env = soapMsg.getSOAPPart().getEnvelope();
Document doc = env.getOwnerDocument();
String inputString = DOMWriter.printNode(soapMsg.getSOAPPart(), true);
SecurityEncoder encoder = new SecurityEncoder(buildOperations(), new SecurityStore());
encoder.encode(doc);
log.debug("Encoded message:" + DOMWriter.printNode(doc, true));
ByteArrayOutputStream stream = new ByteArrayOutputStream();
soapMsg.writeTo(stream);
ByteArrayInputStream instream = new ByteArrayInputStream(stream.toByteArray());
soapMsg = factory.createMessage(null, instream);
env = soapMsg.getSOAPPart().getEnvelope();
doc = env.getOwnerDocument();
SecurityDecoder decoder = new SecurityDecoder(new SecurityStore(), null, null, null);