• 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

Can URLConnection or socket sbe used from within a Session Bean?

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can we use URLConnection object from within Session bean to access some say servlet to send an XML string in request and resceive XML reply. I have told that using Sockets and URL Connection are not recommneded by EJB specifications to be used from with in EJBs.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Exactly. It's not recommended but is definitely possible.
 
tauqeer bhatti
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks ! for your response. Please let me share the following two design choices with you.
One solution as I suggested earlier is using a Session Bean which will use a URLConnection Object to execute certain scritps and receive response form WebServer (this WebServer will be executing those scripts). Session bean may parse the response from the server to draw some meaningfull information.
The other options may be that my session bean just post a Synchornous message (this message may have an XML body containg info. about the percl scritp to be executed)using JMS. Then we can have multiple instances of JMS client appliations which will consume that message and execute requested script. After executing that script they may create an xml message containg the results of the execution. This message reply will be retrurned to my session bean. Session bean now can use results of perl script execution in my J2EE application.
However, I am a little hesitant to use second approach since once perl application is migrated to a java application spending on JM provider will be wasted. However, I'd like to have a session bean facade, since the implementation behind this facade may change with out affecting client programming model.
Looking forward to your input.
Thanks!
 
He puts the "turd" in "saturday". Speaking of which, have you smelled this tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic