ws-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andreas Veithen (Resolved) (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (AXIOM-395) "WrappedTextNodeOMDataSourceFromReader" looses some data when processing large text base message
Date Mon, 24 Oct 2011 17:56:34 GMT

     [ https://issues.apache.org/jira/browse/AXIOM-395?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andreas Veithen resolved AXIOM-395.
-----------------------------------

    Resolution: Invalid
      Assignee: Andreas Veithen

WrappedTextNodeStreamReader generates a CHARACTER event for each chunk it reads from the stream.
If it is used to construct an OMSourcedElement and that element is expanded, then this results
in the creation of multiple OMText nodes (one for each chunk). That means that the behavior
of WrappedTextNodeStreamReader is similar to a non coalescing parser.

The code shown in the issue description gets the first OMText and therefore only returns the
first chunk.

As a conclusion, the code works as designed.


                
> "WrappedTextNodeOMDataSourceFromReader" looses some data when processing large text base
message
> ------------------------------------------------------------------------------------------------
>
>                 Key: AXIOM-395
>                 URL: https://issues.apache.org/jira/browse/AXIOM-395
>             Project: Axiom
>          Issue Type: Bug
>            Reporter: D A Jasintha Kapilajith Dasanayaka
>            Assignee: Andreas Veithen
>            Priority: Critical
>         Attachments: SmooksTestCase.zip, resourceForTestcase.zip
>
>
> we are trying to read larger text content through a mediator using axiom . our  code
is as follows 
>   private static String readFile(String file) throws IOException {
>  
> 	FileInputStream fin = new FileInputStream(file);
> 	OMFactory factory = OMAbstractFactory.getOMFactory();
>         String charSetEnc = BuilderUtil.getCharSetEncoding("text/plain");
>         QName wrapperQName = BaseConstants.DEFAULT_TEXT_WRAPPER;
>         Reader reader;
>         try {
>             reader = new InputStreamReader(fin, charSetEnc);
>         } catch (UnsupportedEncodingException ex) {
>             throw new AxisFault("Unsupported encoding: " + charSetEnc, ex);
>         }
>         OMElement om =  new OMSourcedElementImpl(wrapperQName, factory,
>                 new WrappedTextNodeOMDataSourceFromReader(wrapperQName, reader));
> 		return ((OMText) om.getFirstOMChild()).getText();
> 	}
> Our file size is  8 KB but this method return only 4 KB all other data has been dropped.we
experienced that  there is chunk size defined in WrappedTextNodeStreamReader class and it
has been set to 4096
>  but if return  "om.getText();" we can get the complete String 

--
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: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org


Mime
View raw message