[
https://issues.apache.org/jira/browse/CXF-7185?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Kevin Buntrock updated CXF-7185:
--------------------------------
Description:
Running cxf on a tomcat launched with the jvm argument "-Duser.language=fr".
Mtom and schema validation are enabled.
While sending a soap message, we have this error : "Wrapped by:
org.apache.camel.RuntimeCamelException: org.apache.cxf.interceptor.Fault:
Marshalling Error: cvc-type.3.1.2 : L'élément 'xxx' est de type simple et ne
doit comporter aucun enfant ([children]) de type élément d'information."
Reason is a lack in the hack allowing validation with mtom enabled in
org.apache.cxf.jaxb.io.DataWriterImpl.java.
{code:java}
private static class MtomValidationHandler implements ValidationEventHandler {
ValidationEventHandler origHandler;
JAXBAttachmentMarshaller marshaller;
public MtomValidationHandler(ValidationEventHandler v,
JAXBAttachmentMarshaller m) {
origHandler = v;
marshaller = m;
}
public boolean handleEvent(ValidationEvent event) {
// CXF-1194 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: ")
&&
msg.contains(marshaller.getLastMTOMElementName().getLocalPart())) {
return true;
}
if (origHandler != null) {
return origHandler.handleEvent(event);
}
return false;
}
}
{code}
In french, the colon is always separated with a space from the preceding word.
I would reckon to just not include the colon anymore in the checking. It seams
useless according to this documentation :
https://wiki.xmldation.com/Support/Validator
Looking quickly on the code, some other hacks should not work in french in the
sibling class DataReaderImpl.java.
I will submit a pull request during the week-end to correct this issue.
was:
Running cxf on a tomcat launched with the jvm argument "-Duser.language=fr".
Mtom and schema validation are enabled.
While sending a soap message, we have this error : "Wrapped by:
org.apache.camel.RuntimeCamelException: org.apache.cxf.interceptor.Fault:
Marshalling Error: cvc-type.3.1.2 : L'élément 'xxx' est de type simple et ne
doit comporter aucun enfant ([children]) de type élément d'information."
Reason is a lack in the hack allowing validation with mtom enabled in
org.apache.cxf.jaxb.io.DataWriterImpl.java.
{code:java}
public boolean handleEvent(ValidationEvent event) {
// CXF-1194 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: ")
&&
msg.contains(marshaller.getLastMTOMElementName().getLocalPart())) {
return true;
}
{code}
In french, the colon is always separated with a space from the preceding word.
I would reckon to just not include the colon anymore in the checking. It seams
useless according to this documentation :
https://wiki.xmldation.com/Support/Validator
Looking quickly on the code, some other hacks should not work in french in the
sibling class DataReaderImpl.java.
I will submit a pull request during the week-end to correct this issue.
> Xml validation with Mtom enabled is not working with french locale
> ------------------------------------------------------------------
>
> Key: CXF-7185
> URL: https://issues.apache.org/jira/browse/CXF-7185
> Project: CXF
> Issue Type: Bug
> Components: JAXB Databinding
> Affects Versions: 2.7.18, 3.1.9
> Reporter: Kevin Buntrock
>
> Running cxf on a tomcat launched with the jvm argument "-Duser.language=fr".
> Mtom and schema validation are enabled.
> While sending a soap message, we have this error : "Wrapped by:
> org.apache.camel.RuntimeCamelException: org.apache.cxf.interceptor.Fault:
> Marshalling Error: cvc-type.3.1.2 : L'élément 'xxx' est de type simple et ne
> doit comporter aucun enfant ([children]) de type élément d'information."
> Reason is a lack in the hack allowing validation with mtom enabled in
> org.apache.cxf.jaxb.io.DataWriterImpl.java.
> {code:java}
> private static class MtomValidationHandler implements ValidationEventHandler {
> ValidationEventHandler origHandler;
> JAXBAttachmentMarshaller marshaller;
> public MtomValidationHandler(ValidationEventHandler v,
> JAXBAttachmentMarshaller m) {
> origHandler = v;
> marshaller = m;
> }
> public boolean handleEvent(ValidationEvent event) {
> // CXF-1194 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: ")
> &&
> msg.contains(marshaller.getLastMTOMElementName().getLocalPart())) {
> return true;
> }
>
> if (origHandler != null) {
> return origHandler.handleEvent(event);
> }
> return false;
> }
> }
> {code}
>
> In french, the colon is always separated with a space from the preceding word.
> I would reckon to just not include the colon anymore in the checking. It
> seams useless according to this documentation :
> https://wiki.xmldation.com/Support/Validator
> Looking quickly on the code, some other hacks should not work in french in
> the sibling class DataReaderImpl.java.
> I will submit a pull request during the week-end to correct this issue.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)