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

Amila Chinthaka Suriarachchi commented on AXIS2-4413:
-----------------------------------------------------

At the time of ADB starts it had only getPullparser method. which returns a xml 
reader. This is inefficient compared to directly serialise to the xmlstream 
writer since it creates an intermediate Axiom object.

Then it started with the serialise method which directly serialise the java 
objects to xml stream writer. However some modules like rampart requires to 
build the Axiom tree. But at that time (as you have noticed) serialise method 
has developed a lot. So I did the strategy you have mentioned to re use the 
existing logic in the serialise method.

 public XMLStreamReader getReader() throws XMLStreamException {
        // since only ADBBeans related to elements can be serialized
        // we are safe in passing null here.
        MTOMAwareOMBuilder mtomAwareOMBuilder = new MTOMAwareOMBuilder();
        serialize(mtomAwareOMBuilder);
        return mtomAwareOMBuilder.getOMElement().getXMLStreamReader();
    }

I think within the axiom it gets the xmlstream reader and build the Axom tree 
which already build at the mtomAwareOMBuilder.getOMElement(). 

Therefore if we can add an method to OMDataSourceExt to get an OMElement 
instead of xmlstream reader we can eliminate this efficiency while reusing the 
existing serialise logic.

Otherwise we need to fix getPullParser method with I believe would take a lot 
of time.

> getPullParser methods generated by ADB are broken
> -------------------------------------------------
>
>                 Key: AXIS2-4413
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4413
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>            Reporter: Andreas Veithen
>
> When working on the ADB test suite, I noticed that the getPullParser methods 
> generated by ADB don't work properly. 98 (!) out of 114 existing test cases 
> (working properly with serialize or getOMElement) fail when trying to use 
> getPullParser.
> Probably this is the reason why ADBDataSource#getReader builds an Axiom tree 
> from the bean and gets the XMLStreamReader from this tree (which is highly 
> inefficient) instead of using getPullParser.

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

Reply via email to