CXF, XMLStreamWriter and Encoding

scotestupul

New Member
I have a spring web project that should now be implemented with cxf and web services. One function is to output an xml file. I am using the XMLStreamWriter for this task. Everything works fine.BUT when I add some cxf dependencies into my POM-File, the output xml file gets the "IBM1252" encoding. The xml file can not be read afterwards. Exception: "Invalid encoding name IBM1252" is thrown.I have added following dependencies:\[code\] <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-core</artifactId> <version>${cxf.version}</version> </dependency> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-frontend-jaxws</artifactId> <version>${cxf.version}</version> </dependency> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-transports-http</artifactId> <version>${cxf.version}</version> </dependency>\[/code\]I didn't change anything in my code. And I have even tried this: \[code\] XMLStreamWriter writer = facOut.createXMLStreamWriter(fileWriter); writer.writeStartDocument("UTF-8", "1.0");\[/code\]I still get the "IBM1252" encoding.Does anyone have an idea what could be the reason for it?
 
Back
Top