wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes EJB and XML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB and XML" Watch "EJB and XML" New topic
Author

EJB and XML

sravanthi adhikari
Greenhorn

Joined: Nov 26, 2000
Posts: 9
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
greg philpott
Ranch Hand

Joined: Nov 10, 2000
Posts: 73
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.
sravanthi adhikari
Greenhorn

Joined: Nov 26, 2000
Posts: 9
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
greg philpott
Ranch Hand

Joined: Nov 10, 2000
Posts: 73
>>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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB and XML
 
Similar Threads
DOM Object through Session Facade
Generating XML in EJB
How to handle this kind of XML
how can i implement mvc structure in ejb layer
XML vs. ???