[jbossws-issues] [JBoss JIRA] (JBWS-3411) WSDL generation for javax.jws SOAP services uses system-default character set.

Bastian Blankenburg (Created) (JIRA) jira-events at lists.jboss.org
Wed Jan 11 05:15:09 EST 2012


WSDL generation for javax.jws SOAP services uses system-default character set.
------------------------------------------------------------------------------

                 Key: JBWS-3411
                 URL: https://issues.jboss.org/browse/JBWS-3411
             Project: JBoss Web Services
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: jbossws-native
    Affects Versions: jbossws-native-3.4.1
         Environment: Windows 7, JDK 1.6.0 64bit, JBoss AS 5.1.0GA
            Reporter: Bastian Blankenburg


When deploying a webservice implemented using javax.jws and JAXB annotations, a WSDL is generated. In this process, a temporary XML schema file is generated and written to the tmp directory by the WSDL11Reader.processSchemaInclude method. It uses a DOMWriter in lines 640-646 to actually write the file via a FileWriter. This leads to the schema being written with the system-default character set, without an XML declaration. For non-ASCII characters, this might in turn lead to org.apache.xerces.xni.XNIException being thrown by the xerces parser when the file is read again by the JavaToXSD.parseSchema (line 181) method. 

For example, part of my I have an @XmlEnum with a value "località", specified by @XmlEnumValue("localit\u00e0"), which causes this problem. The exception message in this case is
"Parser should stop: JBossWS_(...)18444939893360070.xsd[domain:http://www.w3.org/TR/1998/REC-xml-19980210]::[key=InvalidByte]::Message=Invalid byte 2 of 3-byte UTF-8 sequence."

Java char supports UTF-16 characters with the "\u" escape sequences. The DOMWriter has another constructor DOMWriter(OutputStream stream, String charsetName) which also causes an XML declaration to be written. Its usage in WSDL11Reader with "UTF-16" as second parameter would thus avoid the described problem.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       



More information about the jbossws-issues mailing list