You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ji...@apache.org on 2004/05/10 18:11:02 UTC

[jira] Commented: (AXIS-1355) SOAPPart.getAsString() assumes document is UTF-8 encoded

The following comment has been added to this issue:

     Author: Davanum Srinivas
    Created: Mon, 10 May 2004 9:10 AM
       Body:
please try latest cvs.

-- dims
---------------------------------------------------------------------
View this comment:
  http://issues.apache.org/jira/browse/AXIS-1355?page=comments#action_35476

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/AXIS-1355

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: AXIS-1355
    Summary: SOAPPart.getAsString() assumes document is UTF-8 encoded
       Type: Bug

     Status: Unassigned
   Priority: Major

    Project: Axis
 Components: 
             Serialization/Deserialization
   Versions:
             1.2 Beta

   Assignee: 
   Reporter: Michael Krumpus

    Created: Mon, 10 May 2004 8:57 AM
    Updated: Mon, 10 May 2004 9:10 AM

Description:
The method getAsString() in SOAPPart assumes that the document is UTF-8 encoded.  This does not work correctly for ISO-8859-1 documents that contain characters with the high-order bit on.  If one calls getAsString() on such a document before it is parsed (e.g. in a logging handler of some sort), the document will not be read correctly -- I've seen it truncated at the offending character.
The workaround is to ensure that any handlers deserialize the document first by making sure getAsSOAPEnvelope() is called first, and then calling getAsString().
Interestingly, if the current form is a deserialized envelope and one wishes to have the raw string for logging purposes, a subsequent call to getAsString() will cause the envelope to be serialized to a string.  I would think that the SOAPPart object would hang on to a copy of the String representation instead of serializing the document it just deserialized.  Keeping the raw string and object graph in synch would be a problem however.



---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira