axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 15130] New: - malformed encoding when SOAPBodyElement's data are not ISO8859_1 characters
Date Fri, 06 Dec 2002 04:18:54 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15130>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15130

malformed encoding when SOAPBodyElement's data are not ISO8859_1 characters

           Summary: malformed encoding when SOAPBodyElement's data are not
                    ISO8859_1 characters
           Product: Axis
           Version: 1.1beta
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Blocker
          Priority: Other
         Component: Serialization/Deserialization
        AssignedTo: axis-dev@xml.apache.org
        ReportedBy: rong@borland.com.cn


When I tried to run the sample "message", I found that if SOAPBodyElement 
encapsulate some characters other than ISO8859_1, for example, Chinese 
characters, Axis could not encoding them to UTF-8 when construct the SOAP 
message stream transfered over HTTP. I used SOAP Monitor to monitor the SOAP 
messages and detected a malformed encoding--the encoding of SOAP message was 
UTF-8, but the Chinese characters I inserted in the message by SOAPBodyElement 
remained GB2312(a Chinese encoding standard) without encoding to UTF-8! So, 
when the server side recived this message, XML parser threw a malformed 
characters exception. The code is as follow:
TestMsg.java
DocumentBuilder builder = DocumentBuilderFactory.newInstance
().newDocumentBuilder();
Document doc            = builder.newDocument();   
Element cdataElem       = doc.createElementNS("urn:foo", "e3");
CDATASection cdata      = doc.createCDATASection("If here are some Chinese 
characters, it can not work");	    
cdataElem.appendChild(cdata);
		
input[2] = new SOAPBodyElement(cdataElem);

Same thing happened once again when I tried to define a serializable class as a 
parameter of JAX-RPC call which contain a string and a DataHandler. the class 
is defined as follow:
public class AttachWrapper  implements java.io.Serializable {
    javax.activation.DataHandler content;
    java.lang.String title;
}
when I construct an AttachWrapper object and set some Chinese characters in 
title variable, then call a JAX-RPC method via WSDL2java generated stub putting 
the object as a parameter, I found that the characters are malformed too in the 
SOAP Monitor.

Mime
View raw message