axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sanjiva Weerawarana <>
Subject Re: [Axis2] Proposal - DOM Implementation for Axis2
Date Tue, 17 May 2005 16:03:53 GMT
On Mon, 2005-05-16 at 13:22 -0500, Aleksander Slominski wrote:
> hi,
> doesn't it mean that XML will be parsed twice or events replayed 
> (PullParser pp = messageContext.getSOAPEnvelope().getPullParser())  and 
> original OM tree that was first built is then discarded (first built by 
> StAXSOAPModelBuilder but without DOM then again by StAXSOAPModelBuilder 
> but with DOM)?

Yep that's what it means.

This is unavoidable .. its a chicken-n-egg situation. We only want to
pay the price of building a DOM (instead of an OM) when WS-Sec (or
someone else) wants it. Now, if the entire system has been set up with
WS-Sec turned on then yes we can build that straight away and no
problem. However, often WS-Sec will be on for some number of services,
but not for all. In order to identify the service you need to read the
headers (maybe .. at least if ws-addr is in use). Thus the chicken comes
before the egg: have to build an OM so we can find the service so that
we can decide that we need a DOM (the egg). Oops.

The proposal Ruchith made solves that problem by allowing you to
switch .. albeit at a cost of duplicating the part of the tree that has
already been built (by piping that thru StaX). BTW I'm very impressed
with our OM design that it allowed us to easily make this work :-).

Plus, in any case, in Sri Lanka we know damned well the chicken came
before the egg anyway; how else could the egg have come into existence
at all?


View raw message