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 "Michael Haeusler (JIRA)" <ji...@apache.org> on 2007/04/11 14:34:32 UTC

[jira] Created: (AXIS2-2505) SOAP XML character encoding is not handled at all, when constucting message from InputStream

SOAP XML character encoding is not handled at all, when constucting message from InputStream
--------------------------------------------------------------------------------------------

                 Key: AXIS2-2505
                 URL: https://issues.apache.org/jira/browse/AXIS2-2505
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
    Affects Versions: 1.0, 1.1, 1.1.1
            Reporter: Michael Haeusler
            Priority: Critical


whenever an existing SOAPMessage is read from an InputStream, the XML parser will use the system default encoding to decode the characters.
obviously this will not work if it doesn't match.


MimeHeaders headers = new MimeHeaders();
headers.addHeader("Content-Type", "text/xml; charset=iso-8859-1");
FileInputStream dataStream = new FileInputStream("test-resources/interop/soap-env-iso.xml");
        
SOAPMessage message = MessageFactory.newInstance().createMessage(headers, dataStream);

now if there is any special character in the xml file it will result in bad data.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Assigned: (AXIS2-2505) SOAP XML character encoding is not handled at all, when constucting message from InputStream

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-2505?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Davanum Srinivas reassigned AXIS2-2505:
---------------------------------------

    Assignee: sumedha rubasinghe

> SOAP XML character encoding is not handled at all, when constucting message from InputStream
> --------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2505
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2505
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>    Affects Versions: 1.1.1, 1.1, 1.0
>            Reporter: Michael Haeusler
>         Assigned To: sumedha rubasinghe
>            Priority: Critical
>         Attachments: patch.diff
>
>
> whenever an existing SOAPMessage is read from an InputStream, the XML parser will use the system default encoding to decode the characters.
> obviously this will not work if it doesn't match.
> MimeHeaders headers = new MimeHeaders();
> headers.addHeader("Content-Type", "text/xml; charset=iso-8859-1");
> FileInputStream dataStream = new FileInputStream("test-resources/interop/soap-env-iso.xml");
>         
> SOAPMessage message = MessageFactory.newInstance().createMessage(headers, dataStream);
> now if there is any special character in the xml file it will result in bad data.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Resolved: (AXIS2-2505) SOAP XML character encoding is not handled at all, when constucting message from InputStream

Posted by "sumedha rubasinghe (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-2505?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

sumedha rubasinghe resolved AXIS2-2505.
---------------------------------------

       Resolution: Fixed
    Fix Version/s: nightly

The revision used to create the patch is quite old & the SOAPPartImpl has changed quite a lot. So I modified the code to include the changes done in the patch. Thanks for the patch.

I am have also added a test case org.apache.axis2.saaj.integration.IntegrationTest -> testSendReceive_ISO88591_EncodedSOAPMessage() to test this.

Thank you.

> SOAP XML character encoding is not handled at all, when constucting message from InputStream
> --------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2505
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2505
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>    Affects Versions: 1.1.1, 1.1, 1.0
>            Reporter: Michael Haeusler
>            Assignee: sumedha rubasinghe
>            Priority: Critical
>             Fix For: nightly
>
>         Attachments: patch.diff
>
>
> whenever an existing SOAPMessage is read from an InputStream, the XML parser will use the system default encoding to decode the characters.
> obviously this will not work if it doesn't match.
> MimeHeaders headers = new MimeHeaders();
> headers.addHeader("Content-Type", "text/xml; charset=iso-8859-1");
> FileInputStream dataStream = new FileInputStream("test-resources/interop/soap-env-iso.xml");
>         
> SOAPMessage message = MessageFactory.newInstance().createMessage(headers, dataStream);
> now if there is any special character in the xml file it will result in bad data.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Updated: (AXIS2-2505) SOAP XML character encoding is not handled at all, when constucting message from InputStream

Posted by "Michael Haeusler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-2505?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Haeusler updated AXIS2-2505:
------------------------------------

    Attachment: patch.diff

I have identified the problem and have attached a patch for this bug.

org.apache.axis2.saaj.SOAPPartImpl 
now honors the character encoding specified in the Content-Type header,
or uses the InputStream constructor of STaX which will autodetect the correct encoding.

I guess this is broken in all Axis 2 SAAJ releases.

> SOAP XML character encoding is not handled at all, when constucting message from InputStream
> --------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2505
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2505
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>    Affects Versions: 1.1.1, 1.1, 1.0
>            Reporter: Michael Haeusler
>            Priority: Critical
>         Attachments: patch.diff
>
>
> whenever an existing SOAPMessage is read from an InputStream, the XML parser will use the system default encoding to decode the characters.
> obviously this will not work if it doesn't match.
> MimeHeaders headers = new MimeHeaders();
> headers.addHeader("Content-Type", "text/xml; charset=iso-8859-1");
> FileInputStream dataStream = new FileInputStream("test-resources/interop/soap-env-iso.xml");
>         
> SOAPMessage message = MessageFactory.newInstance().createMessage(headers, dataStream);
> now if there is any special character in the xml file it will result in bad data.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org