• Post Reply Bookmark Topic Watch Topic
  • New Topic

HTMLReader EJB?

 
Danl Thompson
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I remember once seeing an example of an HTMLReaderEJB, that is, and EJB that opened a URL connection and got an InputStream and read the content. I think there was even a related question on one of the java certifications (J2EA?) once upon a time.
I need something like that now, as I want to call SOAP services from the EJB tier. But this problem keeps plaguing me, EJBs are forbidden from using the java.io package. (For good reason, they would have to wait on i/o!!!). Hence the question, can an EJB read from an HTML stream, and if so how?
My guess is that, if they once could in an earlier J2EE version, they no longer can. But what are the alternatives?
dt
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Even though the specification suggests not to use java.io, you can use it. Just be aware of the fact that you're "on the edge" when it comes to spec-compliancy. Anyway, EJBs are allowed to use client sockets but not server sockets so reading HTML behind a URL or sending SOAP requests is fine.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!