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
sravanthi, I think you should take a look at the java api for xml binding: http://java.sun.com/xml/jaxb/index.html Basically you need to have a DTD to describe instances (xml documents) and you can write a schema to describe how classes should be generated when you run the command line tool. This will allow you to pass xml objects as parameters and access them in your ejb. >>can u pl direct me to an example where it's being used??? read this detailed user guide which shows how to use jaxp for a simple checkbook balancing example: http://www.java.sun.com/xml/jaxb/jaxb-docs.pdf Hope that works for you.
Joined: Nov 26, 2000
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 Bean takes XML object as the 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??? (Say, Microsoft has Recordset.save xmldom adpersitxml).Is there anything similar to this or are there any APIs which have such functions already written? Thanks in advance. S
Joined: Nov 10, 2000
>>Is there a way to save a result set as an xml object?? yes, The generator of the result set should make the result set in xml. If this is not possible, then this involves work and you will have to implement methods to read the resultset and extract data values you need >>say a function or Bean takes XML object as the 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? why can't the function or bean return a result set as an xml document? that would be the most desirable solution