• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EJB and XML

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
>>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
reply
    Bookmark Topic Watch Topic
  • New Topic