Repository: cxf Updated Branches: refs/heads/master 6a1bc2963 -> 720b41e21
[CXF-7438] Expand the checks for MTOM and schema validation Patch from Casper Biever applied Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/720b41e2 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/720b41e2 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/720b41e2 Branch: refs/heads/master Commit: 720b41e218cf0b8103b397ff869aa08222cd98d4 Parents: 6a1bc29 Author: Daniel Kulp <[email protected]> Authored: Tue Aug 1 14:31:09 2017 -0400 Committer: Daniel Kulp <[email protected]> Committed: Tue Aug 1 14:32:21 2017 -0400 ---------------------------------------------------------------------- .../org/apache/cxf/databinding/source/XMLStreamDataWriter.java | 2 +- .../src/main/java/org/apache/cxf/jaxb/io/DataWriterImpl.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/720b41e2/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataWriter.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataWriter.java b/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataWriter.java index d74166a..f82e3ee 100644 --- a/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataWriter.java +++ b/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataWriter.java @@ -222,7 +222,7 @@ public class XMLStreamDataWriter implements DataWriter<XMLStreamWriter> { private boolean isCVC312Exception(SAXParseException exception) { String msg = exception.getMessage(); - return msg.startsWith("cvc-type.3.1.2") + return (msg.startsWith("cvc-type.3.1.2") || msg.startsWith("cvc-complex-type.2.2")) && msg.endsWith("is a simple type, so it must have no element information item [children]."); http://git-wip-us.apache.org/repos/asf/cxf/blob/720b41e2/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataWriterImpl.java ---------------------------------------------------------------------- diff --git a/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataWriterImpl.java b/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataWriterImpl.java index ebc78ec..37555e5 100644 --- a/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataWriterImpl.java +++ b/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataWriterImpl.java @@ -92,9 +92,10 @@ public class DataWriterImpl<T> extends JAXBDataBase implements DataWriter<T> { } public boolean handleEvent(ValidationEvent event) { - // CXF-1194 this hack is specific to MTOM, so pretty safe to leave in here before calling the origHandler. + // CXF-1194/CXF-7438 this hack is specific to MTOM, so pretty safe to leave in + // here before calling the origHandler. String msg = event.getMessage(); - if (msg.startsWith("cvc-type.3.1.2") + if ((msg.startsWith("cvc-type.3.1.2") || msg.startsWith("cvc-complex-type.2.2")) && msg.contains(marshaller.getLastMTOMElementName().getLocalPart())) { return true; }
