[ https://issues.apache.org/jira/browse/CXF-6351?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Aris Tsaklidis updated CXF-6351: -------------------------------- Comment: was deleted (was: Ich bin bis inklusive zum Datum 17.05.2015 nicht im Dienst. Ihre E-Mails an meine E-Mailadresse werden in dieser Zeit nicht bearbeitet. Bei dringenden Fragen wenden Sie sich bitte an Barbara Meyer. Es steht Ihnen ebenfalls die ITG-Serviceline unter servicel...@itg.graz.at bzw. 8484 zu Verfügung. Mit freundlichen Grüßen, DI(FH) Aris Tsaklidis Software Architect ITG IT-Services Schmiedgasse 26/4|8010 Graz Tel.: +43 316 872 8441 Fax: +43 316 872 8409 Mobil: +43 664 60 872 8441 aris.tsakli...@itg.graz.at<mailto:aris.tsakli...@itg.graz.at> egov.graz.gv.at<http://egov.graz.gv.at/> www.graz.at<http://www.graz.at/> Informationstechnik Graz GmbH FN 230910 z, Landes- als Firmenbuchgericht Graz DVR-Nr.: 4003211 | UID-Nr.: ATU 56704908 ) > Character encoding error in XML schema validation > ------------------------------------------------- > > Key: CXF-6351 > URL: https://issues.apache.org/jira/browse/CXF-6351 > Project: CXF > Issue Type: Bug > Affects Versions: 3.0.4, 2.7.15 > Environment: JVM using platform default encoding other than UTF-8 > Reporter: Martin Bonato > Assignee: Daniel Kulp > Fix For: 3.1.0, 2.7.16, 3.0.5 > > > I'm using a WSDL with referenced XML schema files containing german umlaut > characters. The WSDL and schema files reside in the applications classpath. > When XML schema validation is enabled for the corresponding webservice, the > schema validation fails if the platform default encoding is not UTF-8 (e.g. > ISO-8859-1). > I've created a test case for the issue (tested with CXF 2.7.15) > https://github.com/datentechnik/cxf-schema-encoding > When the test case is executed with a {{-Dfile.encoding=ISO-8859-1}} it fails > with: > {noformat} > org.apache.cxf.interceptor.Fault: Could not parse the XML stream caused by: > javax.xml.stream.XMLStreamException: cvc-enumeration-valid: Value 'm�nnlich' > is not facet-valid with respect to enumeration '[männlich, weiblich, > unbekannt]'. It must be a value from the enumeration. > {noformat} > The reason is, schema references in WSDL files are read using platform > default encoding: > {code:title=org.apache.cxf.wsdl.EndpointReferenceUtils.SchemaLSResourceResolver} > private LSInputImpl createInput(String newId, byte[] value) { > LSInputImpl impl = new LSInputImpl(); > impl.setSystemId(newId); > impl.setBaseURI(newId); > impl.setCharacterStream( > new InputStreamReader( > new ByteArrayInputStream(value))); > return impl; > } > {code} > The {{InputStreamReader}} uses the default platform character encoding. I > would recommend to set the InputStream in LSInputImpl instead of the > CharacterStream and let the Schema parser decide on the character encoding. > I've created a pull request https://github.com/apache/cxf/pull/65 which > solves the problem (tested with CXF 2.7.x). > I've only tested with the 2.7.x branch, but from the code I think master is > affected as well. -- This message was sent by Atlassian JIRA (v6.3.4#6332)