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);