• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to pass xml as argument?

 
selvas kumars
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
In a ejb call, what would be best argument type to pass xml?? It should be InputStream or String type?
Thanks & Regards,
silva.
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Either one would work, but a String might be simplest. However, my question is why are you wanting to pass XML to an EJB in the first place -- that's usually not a very good idea -- it usually work sbetter to convert to/from XML outside the EJB and to only pass serializable java objects (e.g. Value objects) to/from the EJB's.
Kyle
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Personally, I have never been a big fan of using XML internally in enterprise applications. It almost always brings more headaches then it does flexibility (which often times never gets utilized anyways). The only place I like to use XML is in the external interfaces of the system and when the data needs to be transformed into multiple views (using XSLT).
So I have to agree with Kyle, you are much better off passing objects. Both from Ease of Use/Maintainability perspective and from a performance perspective.
[ December 12, 2002: Message edited by: Chris Mathews ]
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Chris Mathews:
Personally, I have never been a big fan of using XML internally in enterprise applications...

Question of a Greenhorn: Does that also apply to passing a (J)DOM object as parameter? This way you at least could be sure, that the XML is well formed and valid...
For the XLST: fully agree
:-) stw
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!