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 "Shahi, Ashutosh" <As...@ca.com> on 2005/07/27 09:05:37 UTC

[Axis2] staxSOAPModelBuilder

Hi OMers  ;-),

As part of XML Infoset, there was some code added to next() method in
staxOMBuilder to process comments etc.

But, we have staxSOAPModelBuilder also, where we do not have any such
capability yet. Now comments can be part of soapMessage as well.

I have a test soap message : 

"<?xml version='1.0' encoding='UTF-8'?>" + 

                                    "<!-- Comment -->" +

                                    "<env:Envelope
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +

 
"<env:Body><echo><arg0>Hello</arg0></echo></env:Body>" +

                                    "</env:Envelope>";

 

And doing something like:

stAXSOAPModelBuilder =

                        new StAXSOAPModelBuilder(

                                XMLInputFactory.newInstance()

                        .createXMLStreamReader(inputStream));

Where input stream has soap message with comments gives an OMException.

 

Now my question is: 

Both StaxSOAPModelBuilder and StaxOMBuilder extend the abstract class
StaxBuilder which has next() as abstract method. Why not put the
functionality in next() method of StaxBuilder itself? Or atleast we
should process comments in StaxSOAPModelBuilder as well.

 

-Ashutosh

 


Re: [Axis2] staxSOAPModelBuilder

Posted by jayachandra <ja...@gmail.com>.
Even that would not solve the problem of comment tackling in
StAXSOAPModelBuilder because the next() method of the builder doesn't
cater to the COMMENT event at all, as of now. Given my past experience
in doing the same for StAXOMBuilder, I think I can supply a patch for
this at least minimalistic one (ignoring document level comments). And
may be Eran can review that one.

Jaya

On 7/27/05, Venkat Reddy <vr...@gmail.com> wrote:
> Why not StAXSOAPModelBuilder extend StAXOMBuilder ?
> 
> - venkat
> 
> 
> On 7/27/05, Shahi, Ashutosh <As...@ca.com> wrote:
> >
> >
> >
> > Hi OMers  ;-),
> >
> > As part of XML Infoset, there was some code added to next() method in
> > staxOMBuilder to process comments etc.
> >
> > But, we have staxSOAPModelBuilder also, where we do not have any such
> > capability yet. Now comments can be part of soapMessage as well.
> >
> > I have a test soap message :
> >
> > "<?xml version='1.0' encoding='UTF-8'?>" +
> >
> >                                     "<!-- Comment -->" +
> >
> >                                     "<env:Envelope
> > xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
> >
> >
> > "<env:Body><echo><arg0>Hello</arg0></echo></env:Body>" +
> >
> >                                     "</env:Envelope>";
> >
> >
> >
> > And doing something like:
> >
> > stAXSOAPModelBuilder =
> >
> >                         new StAXSOAPModelBuilder(
> >
> >                                 XMLInputFactory.newInstance()
> >
> >
> > .createXMLStreamReader(inputStream));
> >
> > Where input stream has soap message with comments gives an OMException.
> >
> >
> >
> > Now my question is:
> >
> > Both StaxSOAPModelBuilder and StaxOMBuilder extend the abstract class
> > StaxBuilder which has next() as abstract method. Why not put the
> > functionality in next() method of StaxBuilder itself? Or atleast we should
> > process comments in StaxSOAPModelBuilder as well.
> >
> >
> >
> > -Ashutosh
> >
> >
> 


-- 
-- Jaya

Re: [Axis2] staxSOAPModelBuilder

Posted by Venkat Reddy <vr...@gmail.com>.
Why not StAXSOAPModelBuilder extend StAXOMBuilder ?

- venkat


On 7/27/05, Shahi, Ashutosh <As...@ca.com> wrote:
>  
>  
> 
> Hi OMers  ;-), 
> 
> As part of XML Infoset, there was some code added to next() method in
> staxOMBuilder to process comments etc. 
> 
> But, we have staxSOAPModelBuilder also, where we do not have any such
> capability yet. Now comments can be part of soapMessage as well. 
> 
> I have a test soap message : 
> 
> "<?xml version='1.0' encoding='UTF-8'?>" + 
> 
>                                     "<!-- Comment -->" + 
> 
>                                     "<env:Envelope
> xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" + 
> 
>                                    
> "<env:Body><echo><arg0>Hello</arg0></echo></env:Body>" + 
> 
>                                     "</env:Envelope>"; 
> 
>   
> 
> And doing something like: 
> 
> stAXSOAPModelBuilder = 
> 
>                         new StAXSOAPModelBuilder( 
> 
>                                 XMLInputFactory.newInstance() 
> 
>                        
> .createXMLStreamReader(inputStream)); 
> 
> Where input stream has soap message with comments gives an OMException. 
> 
>   
> 
> Now my question is: 
> 
> Both StaxSOAPModelBuilder and StaxOMBuilder extend the abstract class
> StaxBuilder which has next() as abstract method. Why not put the
> functionality in next() method of StaxBuilder itself? Or atleast we should
> process comments in StaxSOAPModelBuilder as well. 
> 
>   
> 
> -Ashutosh 
> 
>

Re: [Axis2] staxSOAPModelBuilder

Posted by jayachandra <ja...@gmail.com>.
Am attaching a quick patch for community's review. I know there can be
better refactoring done which can reduce the code duplication etc. but
as I said this one is a quick patch disturbing things minimally :-)
If comment support in SOAP model is the need of the hour, one can
think of committing this patch if it looks okay.
I've tested to see the soap message provided by Ashu below passes
properly or not with this patch, and it worked.

Thanks
Jaya
Note: Patch is made from modules/xml/src/org/apache/axis2/soap folder

On 7/27/05, Shahi, Ashutosh <As...@ca.com> wrote:
> 
> 
> Hi OMers  ;-),
> 
> As part of XML Infoset, there was some code added to next() method in
> staxOMBuilder to process comments etc.
> 
> But, we have staxSOAPModelBuilder also, where we do not have any such
> capability yet. Now comments can be part of soapMessage as well.
> 
> I have a test soap message : 
> 
> "<?xml version='1.0' encoding='UTF-8'?>" + 
> 
>                                     "<!-- Comment -->" +
> 
>                                     "<env:Envelope
> xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
> 
>                                    
> "<env:Body><echo><arg0>Hello</arg0></echo></env:Body>" +
> 
>                                     "</env:Envelope>";
> 
>  
> 
> And doing something like:
> 
> stAXSOAPModelBuilder =
> 
>                         new StAXSOAPModelBuilder(
> 
>                                 XMLInputFactory.newInstance()
> 
>                        
> .createXMLStreamReader(inputStream));
> 
> Where input stream has soap message with comments gives an OMException.
> 
>  
> 
> Now my question is: 
> 
> Both StaxSOAPModelBuilder and StaxOMBuilder extend the abstract class
> StaxBuilder which has next() as abstract method. Why not put the
> functionality in next() method of StaxBuilder itself? Or atleast we should
> process comments in StaxSOAPModelBuilder as well.
> 
>  
> 
> -Ashutosh
> 
>  


-- 
-- Jaya

Re: [Axis2] staxSOAPModelBuilder

Posted by Davanum Srinivas <da...@gmail.com>.
Venkat,

Here's Eran's OK to cleanup. Please go ahead.

thanks,
dims

On 7/28/05, Eran Chinthaka <ch...@opensource.lk> wrote:
> Your help in cleaning this up is greatly appreciated. You can go ahead and
> do it.
> 
> Thanks,
> Chinthaka
> 
> >
> > i would add that code duplication for any "performance" reasons that are
> > not proved by profiling is really bad for long term maintainability. and
> > as they say premature optimization is root of all evil ;-)
> >
> > alek
> >
> > Davanum Srinivas wrote:
> >
> > >+1 to clean up and streamline.
> > >
> > >-- dims
> > >
> > >On 7/27/05, Venkat Reddy <vr...@gmail.com> wrote:
> > >
> > >
> > >>Then, lets have StaAXBuilder implement the next() method with all
> > >>common handling which is absolutely required for SOAP processing,
> > >>including comment handling. This is basically what Ashu suggested. The
> > >>derived classes can call the super.next() and then they can handle it
> > >>themselves, if required. But i don't think its going to be too fast
> > >>compared to extending StAXOMBuilder, since the latter adds only two
> > >>more case statements, but code is lot cleaner.
> > >>
> > >>Also, currently i see lot of code duplication across StAXOMBuilder and
> > >>StAXSOAPModelBuilder
> > >>
> > >>- venkat
> > >>
> > >>On 7/28/05, Eran Chinthaka <ch...@opensource.lk> wrote:
> > >>
> > >>
> > >>>
> > >>>Hi Ashu, Venkat and all,
> > >>>
> > >>>
> > >>>
> > >>>I'm 0- on making StAXOMBuilder extend from StAXOMBuilder. Remember our
> > >>>intention in "Axis2" is to make a fast and efficient object model for
> > SOAP
> > >>>processing. We do lot of stuff specific to SOAP in
> > StAXSOAPModelBuilder. And
> > >>>we know for sure StAXSOAPModelBuilder doesn't need to support full
> > infoset.
> > >>>
> > >>>AND, if you look at the code carefully, you might have seen that for
> > each
> > >>>and every information item creation, I have introduced a method in the
> > >>>StAXOMBUilder. Example, createOMELement() etc.,
> > >>>
> > >>>
> > >>>
> > >>>So if you wanna share code between SOAP builder and OM builder, please
> > do
> > >>>put them in StAXBuilder. So perhaps, Ashu you can put your comments
> > creation
> > >>>stuff in StAXBuilder.
> > >>>
> > >>>
> > >>>
> > >>>Regards,
> > >>>
> > >>>Chinthaka
> > >>>
> > >>>
> > >>>
> > >>>
> > >>> ________________________________
> > >>>
> > >>>
> > >>>From: Shahi, Ashutosh [mailto:Ashutosh.Shahi@ca.com]
> > >>> Sent: Wednesday, July 27, 2005 1:06 PM
> > >>> To: axis-dev@ws.apache.org
> > >>> Subject: [Axis2] staxSOAPModelBuilder
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>Hi OMers  ;-),
> > >>>
> > >>>As part of XML Infoset, there was some code added to next() method in
> > >>>staxOMBuilder to process comments etc.
> > >>>
> > >>>But, we have staxSOAPModelBuilder also, where we do not have any such
> > >>>capability yet. Now comments can be part of soapMessage as well.
> > >>>
> > >>>I have a test soap message :
> > >>>
> > >>>"<?xml version='1.0' encoding='UTF-8'?>" +
> > >>>
> > >>>                                    "<!-- Comment -->" +
> > >>>
> > >>>                                    "<env:Envelope
> > >>>xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
> > >>>
> > >>>
> > >>>"<env:Body><echo><arg0>Hello</arg0></echo></env:Body>" +
> > >>>
> > >>>                                    "</env:Envelope>";
> > >>>
> > >>>
> > >>>
> > >>>And doing something like:
> > >>>
> > >>>stAXSOAPModelBuilder =
> > >>>
> > >>>                        new StAXSOAPModelBuilder(
> > >>>
> > >>>                                XMLInputFactory.newInstance()
> > >>>
> > >>>
> > >>>.createXMLStreamReader(inputStream));
> > >>>
> > >>>Where input stream has soap message with comments gives an OMException.
> > >>>
> > >>>
> > >>>
> > >>>Now my question is:
> > >>>
> > >>>Both StaxSOAPModelBuilder and StaxOMBuilder extend the abstract class
> > >>>StaxBuilder which has next() as abstract method. Why not put the
> > >>>functionality in next() method of StaxBuilder itself? Or atleast we
> > should
> > >>>process comments in StaxSOAPModelBuilder as well.
> > >>>
> > >>>
> > >>>
> > >>>-Ashutosh
> > >>>
> > >>>
> > >>>
> > >>>
> > >
> > >
> > >
> > >
> >
> >
> > --
> > The best way to predict the future is to invent it - Alan Kay
> >
> 
> 
> 
> 


-- 
Davanum Srinivas -http://blogs.cocoondev.org/dims/

Re: [Axis2] staxSOAPModelBuilder

Posted by Davanum Srinivas <da...@gmail.com>.
Amen :)

On 7/27/05, Aleksander Slominski <as...@cs.indiana.edu> wrote:
> i would add that code duplication for any "performance" reasons that are
> not proved by profiling is really bad for long term maintainability. and
> as they say premature optimization is root of all evil ;-)
> 
> alek
> 
> Davanum Srinivas wrote:
> 
> >+1 to clean up and streamline.
> >
> >-- dims
> >
> >On 7/27/05, Venkat Reddy <vr...@gmail.com> wrote:
> >
> >
> >>Then, lets have StaAXBuilder implement the next() method with all
> >>common handling which is absolutely required for SOAP processing,
> >>including comment handling. This is basically what Ashu suggested. The
> >>derived classes can call the super.next() and then they can handle it
> >>themselves, if required. But i don't think its going to be too fast
> >>compared to extending StAXOMBuilder, since the latter adds only two
> >>more case statements, but code is lot cleaner.
> >>
> >>Also, currently i see lot of code duplication across StAXOMBuilder and
> >>StAXSOAPModelBuilder
> >>
> >>- venkat
> >>
> >>On 7/28/05, Eran Chinthaka <ch...@opensource.lk> wrote:
> >>
> >>
> >>>
> >>>Hi Ashu, Venkat and all,
> >>>
> >>>
> >>>
> >>>I'm 0- on making StAXOMBuilder extend from StAXOMBuilder. Remember our
> >>>intention in "Axis2" is to make a fast and efficient object model for SOAP
> >>>processing. We do lot of stuff specific to SOAP in StAXSOAPModelBuilder. And
> >>>we know for sure StAXSOAPModelBuilder doesn't need to support full infoset.
> >>>
> >>>AND, if you look at the code carefully, you might have seen that for each
> >>>and every information item creation, I have introduced a method in the
> >>>StAXOMBUilder. Example, createOMELement() etc.,
> >>>
> >>>
> >>>
> >>>So if you wanna share code between SOAP builder and OM builder, please do
> >>>put them in StAXBuilder. So perhaps, Ashu you can put your comments creation
> >>>stuff in StAXBuilder.
> >>>
> >>>
> >>>
> >>>Regards,
> >>>
> >>>Chinthaka
> >>>
> >>>
> >>>
> >>>
> >>> ________________________________
> >>>
> >>>
> >>>From: Shahi, Ashutosh [mailto:Ashutosh.Shahi@ca.com]
> >>> Sent: Wednesday, July 27, 2005 1:06 PM
> >>> To: axis-dev@ws.apache.org
> >>> Subject: [Axis2] staxSOAPModelBuilder
> >>>
> >>>
> >>>
> >>>
> >>>Hi OMers  ;-),
> >>>
> >>>As part of XML Infoset, there was some code added to next() method in
> >>>staxOMBuilder to process comments etc.
> >>>
> >>>But, we have staxSOAPModelBuilder also, where we do not have any such
> >>>capability yet. Now comments can be part of soapMessage as well.
> >>>
> >>>I have a test soap message :
> >>>
> >>>"<?xml version='1.0' encoding='UTF-8'?>" +
> >>>
> >>>                                    "<!-- Comment -->" +
> >>>
> >>>                                    "<env:Envelope
> >>>xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
> >>>
> >>>
> >>>"<env:Body><echo><arg0>Hello</arg0></echo></env:Body>" +
> >>>
> >>>                                    "</env:Envelope>";
> >>>
> >>>
> >>>
> >>>And doing something like:
> >>>
> >>>stAXSOAPModelBuilder =
> >>>
> >>>                        new StAXSOAPModelBuilder(
> >>>
> >>>                                XMLInputFactory.newInstance()
> >>>
> >>>
> >>>.createXMLStreamReader(inputStream));
> >>>
> >>>Where input stream has soap message with comments gives an OMException.
> >>>
> >>>
> >>>
> >>>Now my question is:
> >>>
> >>>Both StaxSOAPModelBuilder and StaxOMBuilder extend the abstract class
> >>>StaxBuilder which has next() as abstract method. Why not put the
> >>>functionality in next() method of StaxBuilder itself? Or atleast we should
> >>>process comments in StaxSOAPModelBuilder as well.
> >>>
> >>>
> >>>
> >>>-Ashutosh
> >>>
> >>>
> >>>
> >>>
> >
> >
> >
> >
> 
> 
> --
> The best way to predict the future is to invent it - Alan Kay
> 
> 


-- 
Davanum Srinivas -http://blogs.cocoondev.org/dims/

Re: [Axis2] staxSOAPModelBuilder

Posted by Aleksander Slominski <as...@cs.indiana.edu>.
Eran Chinthaka wrote:

>Your help in cleaning this up is greatly appreciated. You can go ahead and
>do it.
>  
>
if i had some time i would do this but, unfortunately, as you can see 
fro my much lower particupation i have no time ...

alek

>>i would add that code duplication for any "performance" reasons that are
>>not proved by profiling is really bad for long term maintainability. and
>>as they say premature optimization is root of all evil ;-)
>>
>>alek
>>
>>Davanum Srinivas wrote:
>>
>>    
>>
>>>+1 to clean up and streamline.
>>>
>>>-- dims
>>>
>>>On 7/27/05, Venkat Reddy <vr...@gmail.com> wrote:
>>>
>>>
>>>      
>>>
>>>>Then, lets have StaAXBuilder implement the next() method with all
>>>>common handling which is absolutely required for SOAP processing,
>>>>including comment handling. This is basically what Ashu suggested. The
>>>>derived classes can call the super.next() and then they can handle it
>>>>themselves, if required. But i don't think its going to be too fast
>>>>compared to extending StAXOMBuilder, since the latter adds only two
>>>>more case statements, but code is lot cleaner.
>>>>
>>>>Also, currently i see lot of code duplication across StAXOMBuilder and
>>>>StAXSOAPModelBuilder
>>>>
>>>>- venkat
>>>>
>>>>On 7/28/05, Eran Chinthaka <ch...@opensource.lk> wrote:
>>>>
>>>>
>>>>        
>>>>
>>>>>Hi Ashu, Venkat and all,
>>>>>
>>>>>
>>>>>
>>>>>I'm 0- on making StAXOMBuilder extend from StAXOMBuilder. Remember our
>>>>>intention in "Axis2" is to make a fast and efficient object model for
>>>>>          
>>>>>
>>SOAP
>>    
>>
>>>>>processing. We do lot of stuff specific to SOAP in
>>>>>          
>>>>>
>>StAXSOAPModelBuilder. And
>>    
>>
>>>>>we know for sure StAXSOAPModelBuilder doesn't need to support full
>>>>>          
>>>>>
>>infoset.
>>    
>>
>>>>>AND, if you look at the code carefully, you might have seen that for
>>>>>          
>>>>>
>>each
>>    
>>
>>>>>and every information item creation, I have introduced a method in the
>>>>>StAXOMBUilder. Example, createOMELement() etc.,
>>>>>
>>>>>
>>>>>
>>>>>So if you wanna share code between SOAP builder and OM builder, please
>>>>>          
>>>>>
>>do
>>    
>>
>>>>>put them in StAXBuilder. So perhaps, Ashu you can put your comments
>>>>>          
>>>>>
>>creation
>>    
>>
>>>>>stuff in StAXBuilder.
>>>>>
>>>>>
>>>>>
>>>>>Regards,
>>>>>
>>>>>Chinthaka
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>________________________________
>>>>>
>>>>>
>>>>>From: Shahi, Ashutosh [mailto:Ashutosh.Shahi@ca.com]
>>>>>Sent: Wednesday, July 27, 2005 1:06 PM
>>>>>To: axis-dev@ws.apache.org
>>>>>Subject: [Axis2] staxSOAPModelBuilder
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>Hi OMers  ;-),
>>>>>
>>>>>As part of XML Infoset, there was some code added to next() method in
>>>>>staxOMBuilder to process comments etc.
>>>>>
>>>>>But, we have staxSOAPModelBuilder also, where we do not have any such
>>>>>capability yet. Now comments can be part of soapMessage as well.
>>>>>
>>>>>I have a test soap message :
>>>>>
>>>>>"<?xml version='1.0' encoding='UTF-8'?>" +
>>>>>
>>>>>                                   "<!-- Comment -->" +
>>>>>
>>>>>                                   "<env:Envelope
>>>>>xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
>>>>>
>>>>>
>>>>>"<env:Body><echo><arg0>Hello</arg0></echo></env:Body>" +
>>>>>
>>>>>                                   "</env:Envelope>";
>>>>>
>>>>>
>>>>>
>>>>>And doing something like:
>>>>>
>>>>>stAXSOAPModelBuilder =
>>>>>
>>>>>                       new StAXSOAPModelBuilder(
>>>>>
>>>>>                               XMLInputFactory.newInstance()
>>>>>
>>>>>
>>>>>.createXMLStreamReader(inputStream));
>>>>>
>>>>>Where input stream has soap message with comments gives an OMException.
>>>>>
>>>>>
>>>>>
>>>>>Now my question is:
>>>>>
>>>>>Both StaxSOAPModelBuilder and StaxOMBuilder extend the abstract class
>>>>>StaxBuilder which has next() as abstract method. Why not put the
>>>>>functionality in next() method of StaxBuilder itself? Or atleast we
>>>>>          
>>>>>
>>should
>>    
>>
>>>>>process comments in StaxSOAPModelBuilder as well.
>>>>>
>>>>>
>>>>>
>>>>>-Ashutosh
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>          
>>>>>
>>>
>>>
>>>      
>>>
>>--
>>The best way to predict the future is to invent it - Alan Kay
>>
>>    
>>
>
>
>
>  
>


-- 
The best way to predict the future is to invent it - Alan Kay


RE: [Axis2] staxSOAPModelBuilder

Posted by Eran Chinthaka <ch...@opensource.lk>.
Your help in cleaning this up is greatly appreciated. You can go ahead and
do it.

Thanks,
Chinthaka

> 
> i would add that code duplication for any "performance" reasons that are
> not proved by profiling is really bad for long term maintainability. and
> as they say premature optimization is root of all evil ;-)
> 
> alek
> 
> Davanum Srinivas wrote:
> 
> >+1 to clean up and streamline.
> >
> >-- dims
> >
> >On 7/27/05, Venkat Reddy <vr...@gmail.com> wrote:
> >
> >
> >>Then, lets have StaAXBuilder implement the next() method with all
> >>common handling which is absolutely required for SOAP processing,
> >>including comment handling. This is basically what Ashu suggested. The
> >>derived classes can call the super.next() and then they can handle it
> >>themselves, if required. But i don't think its going to be too fast
> >>compared to extending StAXOMBuilder, since the latter adds only two
> >>more case statements, but code is lot cleaner.
> >>
> >>Also, currently i see lot of code duplication across StAXOMBuilder and
> >>StAXSOAPModelBuilder
> >>
> >>- venkat
> >>
> >>On 7/28/05, Eran Chinthaka <ch...@opensource.lk> wrote:
> >>
> >>
> >>>
> >>>Hi Ashu, Venkat and all,
> >>>
> >>>
> >>>
> >>>I'm 0- on making StAXOMBuilder extend from StAXOMBuilder. Remember our
> >>>intention in "Axis2" is to make a fast and efficient object model for
> SOAP
> >>>processing. We do lot of stuff specific to SOAP in
> StAXSOAPModelBuilder. And
> >>>we know for sure StAXSOAPModelBuilder doesn't need to support full
> infoset.
> >>>
> >>>AND, if you look at the code carefully, you might have seen that for
> each
> >>>and every information item creation, I have introduced a method in the
> >>>StAXOMBUilder. Example, createOMELement() etc.,
> >>>
> >>>
> >>>
> >>>So if you wanna share code between SOAP builder and OM builder, please
> do
> >>>put them in StAXBuilder. So perhaps, Ashu you can put your comments
> creation
> >>>stuff in StAXBuilder.
> >>>
> >>>
> >>>
> >>>Regards,
> >>>
> >>>Chinthaka
> >>>
> >>>
> >>>
> >>>
> >>> ________________________________
> >>>
> >>>
> >>>From: Shahi, Ashutosh [mailto:Ashutosh.Shahi@ca.com]
> >>> Sent: Wednesday, July 27, 2005 1:06 PM
> >>> To: axis-dev@ws.apache.org
> >>> Subject: [Axis2] staxSOAPModelBuilder
> >>>
> >>>
> >>>
> >>>
> >>>Hi OMers  ;-),
> >>>
> >>>As part of XML Infoset, there was some code added to next() method in
> >>>staxOMBuilder to process comments etc.
> >>>
> >>>But, we have staxSOAPModelBuilder also, where we do not have any such
> >>>capability yet. Now comments can be part of soapMessage as well.
> >>>
> >>>I have a test soap message :
> >>>
> >>>"<?xml version='1.0' encoding='UTF-8'?>" +
> >>>
> >>>                                    "<!-- Comment -->" +
> >>>
> >>>                                    "<env:Envelope
> >>>xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
> >>>
> >>>
> >>>"<env:Body><echo><arg0>Hello</arg0></echo></env:Body>" +
> >>>
> >>>                                    "</env:Envelope>";
> >>>
> >>>
> >>>
> >>>And doing something like:
> >>>
> >>>stAXSOAPModelBuilder =
> >>>
> >>>                        new StAXSOAPModelBuilder(
> >>>
> >>>                                XMLInputFactory.newInstance()
> >>>
> >>>
> >>>.createXMLStreamReader(inputStream));
> >>>
> >>>Where input stream has soap message with comments gives an OMException.
> >>>
> >>>
> >>>
> >>>Now my question is:
> >>>
> >>>Both StaxSOAPModelBuilder and StaxOMBuilder extend the abstract class
> >>>StaxBuilder which has next() as abstract method. Why not put the
> >>>functionality in next() method of StaxBuilder itself? Or atleast we
> should
> >>>process comments in StaxSOAPModelBuilder as well.
> >>>
> >>>
> >>>
> >>>-Ashutosh
> >>>
> >>>
> >>>
> >>>
> >
> >
> >
> >
> 
> 
> --
> The best way to predict the future is to invent it - Alan Kay
> 




Re: [Axis2] staxSOAPModelBuilder

Posted by Aleksander Slominski <as...@cs.indiana.edu>.
i would add that code duplication for any "performance" reasons that are 
not proved by profiling is really bad for long term maintainability. and 
as they say premature optimization is root of all evil ;-)

alek

Davanum Srinivas wrote:

>+1 to clean up and streamline.
>
>-- dims
>
>On 7/27/05, Venkat Reddy <vr...@gmail.com> wrote:
>  
>
>>Then, lets have StaAXBuilder implement the next() method with all
>>common handling which is absolutely required for SOAP processing,
>>including comment handling. This is basically what Ashu suggested. The
>>derived classes can call the super.next() and then they can handle it
>>themselves, if required. But i don't think its going to be too fast
>>compared to extending StAXOMBuilder, since the latter adds only two
>>more case statements, but code is lot cleaner.
>>
>>Also, currently i see lot of code duplication across StAXOMBuilder and
>>StAXSOAPModelBuilder
>>
>>- venkat
>>
>>On 7/28/05, Eran Chinthaka <ch...@opensource.lk> wrote:
>>    
>>
>>>
>>>Hi Ashu, Venkat and all,
>>>
>>>
>>>
>>>I'm 0- on making StAXOMBuilder extend from StAXOMBuilder. Remember our
>>>intention in "Axis2" is to make a fast and efficient object model for SOAP
>>>processing. We do lot of stuff specific to SOAP in StAXSOAPModelBuilder. And
>>>we know for sure StAXSOAPModelBuilder doesn't need to support full infoset.
>>>
>>>AND, if you look at the code carefully, you might have seen that for each
>>>and every information item creation, I have introduced a method in the
>>>StAXOMBUilder. Example, createOMELement() etc.,
>>>
>>>
>>>
>>>So if you wanna share code between SOAP builder and OM builder, please do
>>>put them in StAXBuilder. So perhaps, Ashu you can put your comments creation
>>>stuff in StAXBuilder.
>>>
>>>
>>>
>>>Regards,
>>>
>>>Chinthaka
>>>
>>>
>>>
>>>
>>> ________________________________
>>>
>>>
>>>From: Shahi, Ashutosh [mailto:Ashutosh.Shahi@ca.com]
>>> Sent: Wednesday, July 27, 2005 1:06 PM
>>> To: axis-dev@ws.apache.org
>>> Subject: [Axis2] staxSOAPModelBuilder
>>>
>>>
>>>
>>>
>>>Hi OMers  ;-),
>>>
>>>As part of XML Infoset, there was some code added to next() method in
>>>staxOMBuilder to process comments etc.
>>>
>>>But, we have staxSOAPModelBuilder also, where we do not have any such
>>>capability yet. Now comments can be part of soapMessage as well.
>>>
>>>I have a test soap message :
>>>
>>>"<?xml version='1.0' encoding='UTF-8'?>" +
>>>
>>>                                    "<!-- Comment -->" +
>>>
>>>                                    "<env:Envelope
>>>xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
>>>
>>>
>>>"<env:Body><echo><arg0>Hello</arg0></echo></env:Body>" +
>>>
>>>                                    "</env:Envelope>";
>>>
>>>
>>>
>>>And doing something like:
>>>
>>>stAXSOAPModelBuilder =
>>>
>>>                        new StAXSOAPModelBuilder(
>>>
>>>                                XMLInputFactory.newInstance()
>>>
>>>
>>>.createXMLStreamReader(inputStream));
>>>
>>>Where input stream has soap message with comments gives an OMException.
>>>
>>>
>>>
>>>Now my question is:
>>>
>>>Both StaxSOAPModelBuilder and StaxOMBuilder extend the abstract class
>>>StaxBuilder which has next() as abstract method. Why not put the
>>>functionality in next() method of StaxBuilder itself? Or atleast we should
>>>process comments in StaxSOAPModelBuilder as well.
>>>
>>>
>>>
>>>-Ashutosh
>>>
>>>
>>>      
>>>
>
>
>  
>


-- 
The best way to predict the future is to invent it - Alan Kay


Re: [Axis2] staxSOAPModelBuilder

Posted by Davanum Srinivas <da...@gmail.com>.
+1 to clean up and streamline.

-- dims

On 7/27/05, Venkat Reddy <vr...@gmail.com> wrote:
> Then, lets have StaAXBuilder implement the next() method with all
> common handling which is absolutely required for SOAP processing,
> including comment handling. This is basically what Ashu suggested. The
> derived classes can call the super.next() and then they can handle it
> themselves, if required. But i don't think its going to be too fast
> compared to extending StAXOMBuilder, since the latter adds only two
> more case statements, but code is lot cleaner.
> 
> Also, currently i see lot of code duplication across StAXOMBuilder and
> StAXSOAPModelBuilder
> 
> - venkat
> 
> On 7/28/05, Eran Chinthaka <ch...@opensource.lk> wrote:
> >
> >
> >
> > Hi Ashu, Venkat and all,
> >
> >
> >
> > I'm 0- on making StAXOMBuilder extend from StAXOMBuilder. Remember our
> > intention in "Axis2" is to make a fast and efficient object model for SOAP
> > processing. We do lot of stuff specific to SOAP in StAXSOAPModelBuilder. And
> > we know for sure StAXSOAPModelBuilder doesn't need to support full infoset.
> >
> > AND, if you look at the code carefully, you might have seen that for each
> > and every information item creation, I have introduced a method in the
> > StAXOMBUilder. Example, createOMELement() etc.,
> >
> >
> >
> > So if you wanna share code between SOAP builder and OM builder, please do
> > put them in StAXBuilder. So perhaps, Ashu you can put your comments creation
> > stuff in StAXBuilder.
> >
> >
> >
> > Regards,
> >
> > Chinthaka
> >
> >
> >
> >
> >  ________________________________
> >
> >
> > From: Shahi, Ashutosh [mailto:Ashutosh.Shahi@ca.com]
> >  Sent: Wednesday, July 27, 2005 1:06 PM
> >  To: axis-dev@ws.apache.org
> >  Subject: [Axis2] staxSOAPModelBuilder
> >
> >
> >
> >
> > Hi OMers  ;-),
> >
> > As part of XML Infoset, there was some code added to next() method in
> > staxOMBuilder to process comments etc.
> >
> > But, we have staxSOAPModelBuilder also, where we do not have any such
> > capability yet. Now comments can be part of soapMessage as well.
> >
> > I have a test soap message :
> >
> > "<?xml version='1.0' encoding='UTF-8'?>" +
> >
> >                                     "<!-- Comment -->" +
> >
> >                                     "<env:Envelope
> > xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
> >
> >
> > "<env:Body><echo><arg0>Hello</arg0></echo></env:Body>" +
> >
> >                                     "</env:Envelope>";
> >
> >
> >
> > And doing something like:
> >
> > stAXSOAPModelBuilder =
> >
> >                         new StAXSOAPModelBuilder(
> >
> >                                 XMLInputFactory.newInstance()
> >
> >
> > .createXMLStreamReader(inputStream));
> >
> > Where input stream has soap message with comments gives an OMException.
> >
> >
> >
> > Now my question is:
> >
> > Both StaxSOAPModelBuilder and StaxOMBuilder extend the abstract class
> > StaxBuilder which has next() as abstract method. Why not put the
> > functionality in next() method of StaxBuilder itself? Or atleast we should
> > process comments in StaxSOAPModelBuilder as well.
> >
> >
> >
> > -Ashutosh
> >
> >
> 


-- 
Davanum Srinivas -http://blogs.cocoondev.org/dims/

Re: [Axis2] staxSOAPModelBuilder

Posted by Venkat Reddy <vr...@gmail.com>.
Then, lets have StaAXBuilder implement the next() method with all
common handling which is absolutely required for SOAP processing,
including comment handling. This is basically what Ashu suggested. The
derived classes can call the super.next() and then they can handle it
themselves, if required. But i don't think its going to be too fast
compared to extending StAXOMBuilder, since the latter adds only two
more case statements, but code is lot cleaner.

Also, currently i see lot of code duplication across StAXOMBuilder and
StAXSOAPModelBuilder

- venkat

On 7/28/05, Eran Chinthaka <ch...@opensource.lk> wrote:
>  
>  
> 
> Hi Ashu, Venkat and all, 
> 
>   
> 
> I'm 0- on making StAXOMBuilder extend from StAXOMBuilder. Remember our
> intention in "Axis2" is to make a fast and efficient object model for SOAP
> processing. We do lot of stuff specific to SOAP in StAXSOAPModelBuilder. And
> we know for sure StAXSOAPModelBuilder doesn't need to support full infoset. 
> 
> AND, if you look at the code carefully, you might have seen that for each
> and every information item creation, I have introduced a method in the
> StAXOMBUilder. Example, createOMELement() etc., 
> 
>   
> 
> So if you wanna share code between SOAP builder and OM builder, please do
> put them in StAXBuilder. So perhaps, Ashu you can put your comments creation
> stuff in StAXBuilder. 
> 
>   
> 
> Regards, 
> 
> Chinthaka 
> 
>   
>  
>  
>  ________________________________
>  
> 
> From: Shahi, Ashutosh [mailto:Ashutosh.Shahi@ca.com] 
>  Sent: Wednesday, July 27, 2005 1:06 PM
>  To: axis-dev@ws.apache.org
>  Subject: [Axis2] staxSOAPModelBuilder 
>  
> 
>   
> 
> Hi OMers  ;-), 
> 
> As part of XML Infoset, there was some code added to next() method in
> staxOMBuilder to process comments etc. 
> 
> But, we have staxSOAPModelBuilder also, where we do not have any such
> capability yet. Now comments can be part of soapMessage as well. 
> 
> I have a test soap message : 
> 
> "<?xml version='1.0' encoding='UTF-8'?>" + 
> 
>                                     "<!-- Comment -->" + 
> 
>                                     "<env:Envelope
> xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" + 
> 
>                                    
> "<env:Body><echo><arg0>Hello</arg0></echo></env:Body>" + 
> 
>                                     "</env:Envelope>"; 
> 
>   
> 
> And doing something like: 
> 
> stAXSOAPModelBuilder = 
> 
>                         new StAXSOAPModelBuilder( 
> 
>                                 XMLInputFactory.newInstance() 
> 
>                        
> .createXMLStreamReader(inputStream)); 
> 
> Where input stream has soap message with comments gives an OMException. 
> 
>   
> 
> Now my question is: 
> 
> Both StaxSOAPModelBuilder and StaxOMBuilder extend the abstract class
> StaxBuilder which has next() as abstract method. Why not put the
> functionality in next() method of StaxBuilder itself? Or atleast we should
> process comments in StaxSOAPModelBuilder as well. 
> 
>   
> 
> -Ashutosh 
> 
>

RE: [Axis2] staxSOAPModelBuilder

Posted by Eran Chinthaka <ch...@opensource.lk>.
Hi Ashu, Venkat and all,

 

I'm 0- on making StAXOMBuilder extend from StAXOMBuilder. Remember our
intention in "Axis2" is to make a fast and efficient object model for SOAP
processing. We do lot of stuff specific to SOAP in StAXSOAPModelBuilder. And
we know for sure StAXSOAPModelBuilder doesn't need to support full infoset.

AND, if you look at the code carefully, you might have seen that for each
and every information item creation, I have introduced a method in the
StAXOMBUilder. Example, createOMELement() etc.,

 

So if you wanna share code between SOAP builder and OM builder, please do
put them in StAXBuilder. So perhaps, Ashu you can put your comments creation
stuff in StAXBuilder. 

 

Regards,

Chinthaka

 

  _____  

From: Shahi, Ashutosh [mailto:Ashutosh.Shahi@ca.com] 
Sent: Wednesday, July 27, 2005 1:06 PM
To: axis-dev@ws.apache.org
Subject: [Axis2] staxSOAPModelBuilder

 

Hi OMers  ;-),

As part of XML Infoset, there was some code added to next() method in
staxOMBuilder to process comments etc.

But, we have staxSOAPModelBuilder also, where we do not have any such
capability yet. Now comments can be part of soapMessage as well.

I have a test soap message : 

"<?xml version='1.0' encoding='UTF-8'?>" + 

                                    "<!-- Comment -->" +

                                    "<env:Envelope
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +

 
"<env:Body><echo><arg0>Hello</arg0></echo></env:Body>" +

                                    "</env:Envelope>";

 

And doing something like:

stAXSOAPModelBuilder =

                        new StAXSOAPModelBuilder(

                                XMLInputFactory.newInstance()

                        .createXMLStreamReader(inputStream));

Where input stream has soap message with comments gives an OMException.

 

Now my question is: 

Both StaxSOAPModelBuilder and StaxOMBuilder extend the abstract class
StaxBuilder which has next() as abstract method. Why not put the
functionality in next() method of StaxBuilder itself? Or atleast we should
process comments in StaxSOAPModelBuilder as well.

 

-Ashutosh