Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About Webservices with EJB

 
Moayad Abu Jaber
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rancher,
I want ask about the webservices and EJB, the Mastering EJB 3.0 book have one chapter for this issue.
Indeed the book talk about stateless session bean, they didn't mention more about stateful session bean.
I need to know if we can develop stateful session bean as web services or not.

anyone have information for this issue.
 
Dustin Johnson
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nope, Web Services are implemented as stateless session beans. When you think about it, this would make sense. When you submit to a web service, all of the information it needs to perform the task is received at once. It does not need to keep state, and any future submission to the Web Service will result in a brand new "session".

There is one other way to define a Web Service through J2EE however, namely a servlet. This also makes sense, as a servlet follows a similar lifecycle as a stateless session bean. Neither should have instance variables to hold the state of the client, as with each invocation the client may get a different instance. But for SCBCD, we obviously would only contain about the stateless session bean version.

Hope that helps.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic