Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D90CF200C44 for ; Mon, 27 Mar 2017 18:39:46 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D7C84160B7B; Mon, 27 Mar 2017 16:39:46 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 06E95160B99 for ; Mon, 27 Mar 2017 18:39:45 +0200 (CEST) Received: (qmail 85339 invoked by uid 500); 27 Mar 2017 16:39:45 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 85158 invoked by uid 99); 27 Mar 2017 16:39:45 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Mar 2017 16:39:45 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id A54E9183A68 for ; Mon, 27 Mar 2017 16:39:44 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id hSzS4bY-SRCW for ; Mon, 27 Mar 2017 16:39:43 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 4B67C5FD8B for ; Mon, 27 Mar 2017 16:39:43 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 5A683E088A for ; Mon, 27 Mar 2017 16:39:42 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id B6E582406D for ; Mon, 27 Mar 2017 16:39:41 +0000 (UTC) Date: Mon, 27 Mar 2017 16:39:41 +0000 (UTC) From: "Daniel Kulp (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (CXF-7064) DelegatingXMLStreamWriter.writeCData(text) writes several CDATA sections for a signed XML file MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 27 Mar 2017 16:39:47 -0000 [ https://issues.apache.org/jira/browse/CXF-7064?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:all-tabpanel ] Daniel Kulp resolved CXF-7064. ------------------------------ Resolution: Invalid Fix Version/s: Invalid This is likely a woodstox issue as the call to writeCData is just delegated= into there. It probably does some sort of buffering so POSSIBLY setting = a implementation specific buffer size setting MIGHT do it, but I really don= 't know. In anycase, not an issue with CXF. > DelegatingXMLStreamWriter.writeCData(text) writes several CDATA sections = for a signed XML file > -------------------------------------------------------------------------= --------------------- > > Key: CXF-7064 > URL: https://issues.apache.org/jira/browse/CXF-7064 > Project: CXF > Issue Type: Bug > Components: JAX-WS Runtime > Affects Versions: 3.1.7 > Environment: windows 7/ linux centos 6 > Reporter: Javier Irazaz=C3=A1bal > Fix For: Invalid > > Original Estimate: 168h > Remaining Estimate: 168h > > HI, > When implementing a CDATA interceptor in order to include a signed XML fi= le in a SOAP envelope, we are getting several CDATA sections in the XML tha= t makes the service reject the envelope:=20 > {code:java} > import java.util.regex.Pattern; > import javax.xml.stream.XMLStreamException; > import javax.xml.stream.XMLStreamWriter; > import org.apache.cxf.staxutils.DelegatingXMLStreamWriter; > =20 > /** > * Simple CDATA XML Stream Writer that exports some items as CDATA > */ > public class CDataXMLStreamWriter extends DelegatingXMLStreamWriter { > =20 > private static final Pattern XML_CHARS =3D Pattern.compile( "[&<>]" )= ; > private static final String CDataOpen =3D " private static final String CDataClose =3D "]]>"; > =20 > public CDataXMLStreamWriter(XMLStreamWriter del) {=20 > =09super(del); > }=20 > @Override=20 > public void writeCharacters(String text) throws XMLStreamException {= =20 > =09boolean useCData =3D XML_CHARS.matcher( text ).find(); > =09if (useCData) { > =09=09//super.writeCharacters(CDataOpen); > System.out.println("text" + text); =09=09 > =09=09//super.writeCharacters(text); > =09=09//super.writeCharacters(CDataClose); > =09=09super.writeCData(text); > =09}else {=20 > =09=09super.writeCharacters(text);=20 > =09}=20 > } > =20 > public void writeStartElement(String local) throws XMLStreamException= {=20 > =09super.writeStartElement(local);=20 > }=20 > } > {code} > That's urgent to solve this for us.=20 > This is an example of the unwanted output: > EwJVWTErMCkGA1UECgwiQURNSU5JU1RSQUNJT04gTkFDSU9OQUwgREUgQ09SUk]]> CwwWU0VSVklDSU9TIEVMRUNUUk9OSUNPUzEdMBsGA1UEAwwUQ29ycmVvIFVydWd1YXlvIC0gQ= 0Ew > HhcNMTUxMTI3MTk0NzE4WhcNMTYxMTI3MTk0NzE4WjCBmzEmMCQGCSqGSIb3DQEJARYXdml0Y= W1p > bmljby4wNUBnbWFpbC5jb20xEzARBgNVBAoMClZJVEFNSU5JQ08xEzARBgNVBAgMCk1vbnRld= mlk > ZW8xCzAJBgNVBAYTAlVZMRgwFgYDVQQFEw9SVUMyMTUyMTcxOTAwMTUxIDAeBgN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