Repository: cxf Updated Branches: refs/heads/3.1.x-fixes 2da123931 -> 33a81d35a
StaxSerializer fails on content encryption if there is whitespace child nodes Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/643e2b52 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/643e2b52 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/643e2b52 Branch: refs/heads/3.1.x-fixes Commit: 643e2b52df4494a9dca95fa9a1e769e521a5d2c3 Parents: 2da1239 Author: Colm O hEigeartaigh <[email protected]> Authored: Tue Jan 31 13:23:56 2017 +0000 Committer: Colm O hEigeartaigh <[email protected]> Committed: Tue Jan 31 15:06:53 2017 +0000 ---------------------------------------------------------------------- .../apache/cxf/ws/security/wss4j/StaxSerializer.java | 15 --------------- 1 file changed, 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/643e2b52/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/StaxSerializer.java ---------------------------------------------------------------------- diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/StaxSerializer.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/StaxSerializer.java index 6927500..7d5d881 100644 --- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/StaxSerializer.java +++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/StaxSerializer.java @@ -38,17 +38,14 @@ import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; import javax.xml.stream.XMLStreamWriter; import javax.xml.transform.dom.DOMResult; -import javax.xml.transform.dom.DOMSource; import org.w3c.dom.Document; import org.w3c.dom.DocumentFragment; import org.w3c.dom.Element; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; -import org.w3c.dom.NodeList; import org.xml.sax.InputSource; - import org.apache.cxf.binding.soap.saaj.SAAJStreamWriter; import org.apache.cxf.helpers.LoadingByteArrayOutputStream; import org.apache.cxf.staxutils.StaxUtils; @@ -207,18 +204,6 @@ public class StaxSerializer extends AbstractSerializer { } } - @Override - public byte[] serializeToByteArray(NodeList content) throws Exception { - try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) { - XMLStreamWriter writer = StaxUtils.createXMLStreamWriter(baos); - for (int i = 0; i < content.getLength(); i++) { - StaxUtils.copy(new DOMSource(content.item(i)), writer); - } - writer.close(); - return baos.toByteArray(); - } - } - /** * @param ctx * @param inputSource
