File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Web service develepment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Web service develepment" Watch "Web service develepment" New topic
Author

Web service develepment

swarupa patil
Ranch Hand

Joined: Feb 22, 2006
Posts: 62
Hi,
I am new to web services development.
I am developing web services using EJB 3.0.
I am confused on web service development using
stateless session bean.

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?
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2906
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.


"Don't succumb to the false authority of a tool or model. There is no substitute for thinking."
Andy Hunt, Pragmatic Thinking & Learning: Refactor Your Wetware p.41
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Web service develepment
 
Similar Threads
Client for Stateless Session Bean Service
SCEA assignment query
Stateful Session Beans CAN be used as web services
stateless session bean and web service
Calling a web service from an session bean.