javaee / metro-jax-ws

https://javaee.github.io/metro-jax-ws/
Other
132 stars 68 forks source link

JAX-WS cannot handle double-byte data #318

Open glassfishrobot opened 17 years ago

glassfishrobot commented 17 years ago

The runtime does not use charset from the Content-Type to: – write to the output stream – read from the input stream

Environment

Operating System: All Platform: All

Affected Versions

[JAXWS 2.1.1 RC1]

glassfishrobot commented 17 years ago

Reported by ssso@java.net

glassfishrobot commented 17 years ago

ssso@java.net said: Created an attachment (id=108) Proposed patch

glassfishrobot commented 17 years ago

ssso@java.net said: The patch is based on 2.1.1 RC1 (code from 04/12/2007).

Please review. Suggestions welcomed:

1. The use of invocationProperties to carry over the char set encoding 2. constants – "utf-8" and "1.0" (xml version) shows up over and over again – would we be able to make them constants? 3. WSDL with a different char set encoding hasn't dealt with. 4. I only tested the StreamMessage code path. Haven't done the SAAJMessage and ProtocolSourceMessage. Need to develop unit tests around that area. 5. Borrowed code from javax.mail.internet.ContentType to parse the charset encoding. How to give proper credit to the author? Better way to parse the charset encoding?

glassfishrobot commented 17 years ago

jitu@java.net said: Assigning it to jitu

glassfishrobot commented 17 years ago

jitu@java.net said:

Let me know if this works for the receiving messages. I do not see any advantages in doing the same for sending. JAXB creates utf-8 encoding for the beans and writes directly to the OutputStream(instead of using XMLStreamWriter). This gives great performance. So at present, the messages are alwasys sent in utf-8 encoding.

glassfishrobot commented 17 years ago

jitu@java.net said: While receiving, it uses charset from the Content-Type. JAX-WS sends the message as utf-8 since all the receivers are expected to understand utf-8. I haven't heard any limitation to this. May be there is a usecase, that requires sending of data with a preferred encoding. But at present, I am making this as Enhancement fwhile sending is concerned.

glassfishrobot commented 17 years ago

jitu@java.net said: Marking it as Enhancement

glassfishrobot commented 17 years ago

File: jaxws-i18n.diff Attached By: ssso@java.net

glassfishrobot commented 17 years ago

Was assigned to jitu@java.net

glassfishrobot commented 7 years ago

This issue was imported from java.net JIRA JAX_WS-318