Consider using a session bean as a service for accepting and returning XML byte 
streams, but delegating the actual parsing and file handling to specific (non-EJB)
handlers.  The intent is to write non-EJB, reusable components and then wrap these 
components in session beans to form a scalable service layer.  These components
can then exist outside the context of an EJB environment.  In most cases you'll want 
XML handlers that aren't forever and always used in EJBs.

Mike

"Pabolu, Ravikumar (CTS)" wrote:

> Hi ,
> every where i hear abt b2b and the usage of  ejb and xml.
> right in the first place i m facing a problem. thats with creation of
> Document in an entity/session bean.
> i know that the specification wont allow java.io package, then my doubt is
> how could it be possible to construct a dom object
> out of a string and parse it or use it.
> can any one please throw the light on the usage of xml in ejb.
> i have ended up using the ejb just for getting the stringified xml from the
> database and returning it to a servlet which inturn
> creates the DOM object and parses and does the needed processing.
>
> when i write the following code in the beans method i m getting
> "java.io.FileNotFoundException";
> is it due the container rejecting the piece of code i have written or due to
> some other file which the parser is looking for?.
>
> try {
>         StringReader reader = new StringReader("<xml
> version...................the contents of xml.........>");
>         InputSource source = new InputSource(reader);
>         DOMParser parser = new DOMParser();
>         parser.parse(source);
>         return  parser.getDocument();
>
> } catch (Exception e)
> {
>         e.printStackTrace();
> }
>
> >>>>>>>> PS: reply to [EMAIL PROTECTED]
>
> thanx in advance
> ravi kumar pabolu
>
> This e-mail and any files transmitted with it are for the sole use of the intended 
>recipient(s) and may contain confidential and privileged information.
> If you are not the intended recipient, please contact the sender by reply e-mail and 
>destroy all copies of the original message.
> Any unauthorised review, use, disclosure, dissemination, forwarding, printing or 
>copying of this email or any action taken in reliance on this e-mail is strictly
> prohibited and may be unlawful.
>
>                 Visit us at http://www.cognizant.com
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".

--
//////////////////////////////////////////////////////
//
//  Mike Clark
//
//  Clarkware Consulting
//  Enterprise Java Architecture, Design, Development
//
//  http://www.clarkware.com
//  [EMAIL PROTECTED]
//  +1.720.851.2014
//

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to