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 "Hudson (JIRA)" <ji...@apache.org> on 2012/04/28 03:16:48 UTC

[jira] [Commented] (AXIS2-2508) Performance Improvement: Change SOAPBuilder to use InputStream instead of Reader

    [ https://issues.apache.org/jira/browse/AXIS2-2508?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13264183#comment-13264183 ] 

Hudson commented on AXIS2-2508:
-------------------------------

Integrated in Axis2 #1394 (See [https://builds.apache.org/job/Axis2/1394/])
    Removed the code that attempts to determine the charset encoding and/or byte order using the algorithm described in the "Autodetection of Character Encodings" appendix of the XML spec. It is the role of the XML parser to do that. The code was necessary in earlier Axis2 versions because the message builders used a Reader instead of an InputStream (see AXIS2-2508). Since they now pass the InputStream directly to the parser, the getCharSetEncoding thing is no longer required. (Revision 1331552)

     Result = SUCCESS
veithen : 
Files : 
* /axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/builder/BuilderUtil.java
* /axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/builder/MTOMBuilder.java
* /axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/builder/SOAPBuilder.java

                
> Performance Improvement: Change SOAPBuilder to use InputStream instead of Reader
> --------------------------------------------------------------------------------
>
>                 Key: AXIS2-2508
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2508
>             Project: Axis2
>          Issue Type: Bug
>          Components: kernel
>            Reporter: Rich Scheuerle
>
> During some performance testing, we discovered that the SOAPBuilder code converts an InputStream into a Reader.
> streamReader = StAXUtils.createXMLStreamReader(BuilderUtil.getReader(inputStream, charSetEncoding));
> I wholeheartedly agree with the new code structure to use the BOM information that is embedded in the InputStream.  
> But we probably shouldn't convert the entire InputStream into a Reader.
> So I have created an improvement on the current solution.
> Here is the same snippet of code in the new solution:
>            // Get the actual encoding by looking at the BOM of the InputStream
>            PushbackInputStream pis = BuilderUtil.getPushbackInputStream(inputStream);
>            String actualCharSetEncoding = BuilderUtil.getCharSetEncoding(pis, charSetEncoding);
>                     
>            // Get the XMLStreamReader for this input stream
>            streamReader = StAXUtils.createXMLStreamReader(pis, actualCharSetEncoding);
> This new solution still uses BOM detection, but it also does not require a full translation into a Reader.
> I have completed the testing for this change, and will be committing it shortly.
> I don't believe that this is a controversal change, but if anyone disagrees please contact me.
>   

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

        

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