Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to pass XML Document from one EJB to another EJB?

 
Jayakumar Gopalan
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
While trying to pass XML Document from one EJB to another EJB, I got NotSerializableException? Later I found that org.w3c.dom.Document is not serializable. Then I thought I can convert the xml to string and pass it. But I couldn't find any API's for directly parsing the xml string (I am using JAXP). Since it is not possible to use IO classess in EJB, can anybody suggest me any alternatet ways to do this.
Thanks in advance.
Regards,
 
Vivek Viswanathan
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
You could probally use InputSource to conver the Document object into a string that can be sent to the EJB Server. Have a look at it in the API
Vivek
 
Jayakumar Gopalan
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know how to convert the Document to string i.e. like this
Document doc = ....
org.apache.crimson.tree.XmlDocument xmlDoc = (XmlDocument) doc;
String xmlString = xmlDoc.toString();
I want to how to convert the string which contains the valid xml content (in this case xmlString) to form DOM Document.
Please help.
Regards,
Jayakumar
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic