It depends on where you are storing the state. If the state is shared you don't need stickiness. Otherwise, yes you could use a smart lb and sticky sessions. Most likely using header insertion.
Is it possible to affect the HTTP header from a statless session
bean that is exposed as a webservice?
Where is it possible to do "header insertion"?
The goal to keep J2EE web services stateless is to bring simplicity and aid interoperability. Given this, I think you are doing the right approach of passing some form of session identifier to your business method in SLSB.
It is now upto your business code to deal with stickiness. Maybe a common database in a cluster which stores data that is dependent on state id that was passed to the biz method.
As far as the WS infrastructure is concerned, it has dispatched the request that contains custom session id to the bean. Now as a biz developer, deal with it. :-)
The possibilities are endless. Keep stateless in mind and you will be happy.
Jason is right, a load balancer that supports sicky sessions will do. Tomcat handles the cookies.
Ideally you would pass the buisiness session id in a SOAP header and have a handler deal with it.
Thank you for the replys.