EJB-Design---Passing XML objects as parameters to EJBs

Discussions

EJB design: EJB-Design---Passing XML objects as parameters to EJBs

  1. Hi All,
    I was wondering if it is a good way to pass XML objects(instead of strings or other parameters) as parameters to EJB's and access them within ejbs and return back XML objects as results or data from ejbs and use the xml objects for data manipulation or presentation using xsl.
    If it's a good way of doing, can u pl direct me to an example where it's being used???
    Thanks a lot...
    Su
  2. Yes it is better to pass xml as org.w3c.dom.Document object to an ejb rather than a string. especialy if you already have the xml in memory as an object before calling your ejb, and if you inted to manipulate the resulting xml from your ejb later on in your code. Marsheling xml data into DOM objects is a memory monger. You need to limit the number of times you have to marshel your xml data in order to get decent performance from your app. You will find a list on this exact subject in the patterns section of this site.

    <p>XML Data Generation from EJB's</p>
  3. Hi,
    Thanks a lot for the reply.
    Sorry for this dumb question. Is there a way to save a result set as an xml object?? I mean , say a function or Beab takes XML object as an input and does some data manipulation say a search and returns a result set, how do i pass back this result set as an xml object???R there any APIs which have such functions already written?
    Thanks in advance.
    Su