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 Sanjiva Weerawarana <sa...@opensource.lk> on 2005/10/13 04:43:52 UTC

Re: [axis2] "simple" axis data binding architecture and approach for rpc support

On Thu, 2005-10-13 at 07:58 +0600, Eran Chinthaka wrote:
> Pull parsing means application is controlling the stuff. Here you are
> trying to push the stuff using pull interface which is ok but not
> nice, IMO. And the usage of these beans are that you may create OM out
> of this. 
> For example, when you invoke a method public Person
> getPersonInfo(......), 
> Person p = serivceImpl.getPersonInfo(....);
> OMElement bodyFirstChild = new
> StaxOMBuilder(p.getPullParser(QName)).getDocumentElement();
> envelope.getBody().addChild(bodyFirstChild);

Eric, this approach allows us to totally defer doing any XMLification
until the last second. That is, unless someone needs the whole SOAP body
for some reason (say to compute a signature), the "bodyFirstChild"
element created above isn't actually an element in memory .. its just a
thing that can convert the Java object to an element if needed. By
having the pull API, the transport sender which is sending the message
to the wire can pull the events and pump them out directly. That avoids
creating an in-memory representation of the XML representation of the
JavaBean. 

> Our design should fit in to that scenario.
> 
> BTW, if the method was to p.writeToXml( new QName ("myPerson"), new
> ImplOfXmlStreamWriter() ) my job would have been much easier  ;-) 

Oh come on its fun to write YAPP (yet another pull parser) :).

Sanjiva.