Originally posted by swarupa patil: What is use of state less session bean when we are developing web services?
What is advantages of stateless session bean on web service development?
Web services are supposed to be stateless (HTTP is a stateless protocol and applications with no state on the server scale better) so that is why you can only use an SLSB. When you turn an SLSB into a web service you lose two major features that are usually the reason for using EJBs in the first place: declarative transaction control and security.
You may be tempted to use an SLSB so that application servers behind the same firewall can use it instead of the web service interface - the SLSB communication is faster (requires less bandwidth and (de)serialization is faster than XML (un)marshalling); however in doing so you may lose some flexibility in what you could be doing with your web service interface.
It usually makes more sense to implement your service with POJOs and use them together with a web service interface to build a web service (and add WS-Security and WS-Atomic Transaction support if required). Then you can reuse the POJOs to implement the same service with an SLSB interface (using EJB security and transaction control if required). That way you have the best of both worlds.