aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes How to pass XML Document from one EJB to another EJB? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "How to pass XML Document from one EJB to another EJB?" Watch "How to pass XML Document from one EJB to another EJB?" New topic
Author

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

Jayakumar Gopalan
Greenhorn

Joined: Jan 27, 2001
Posts: 20
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

Joined: Mar 03, 2001
Posts: 350
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


Vivek Viswanathan SCJP 1.2, SCJP 1.6,SCJD,SCEA,SCWCD,IBM-484,IBM-486,IBM-141,Ms.NET C# 70-316,SCMAD, LPIC-I
Jayakumar Gopalan
Greenhorn

Joined: Jan 27, 2001
Posts: 20
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to pass XML Document from one EJB to another EJB?