Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Accessing WebService within session facade, or another SLSB

 
Marcelo Ortega
Ranch Hand
Posts: 528
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a session facade implemented as a Stateless session bean (with Local interface).
The session facde is centralizing security and transaction management, plus some minor business logic.
It has an EntityManager which it uses for persisting / retrieving JPA Entities

My question is, given all of the responsibilities of the above session facade, should we use the same
to access a webservice (using @WebServiceRef), or should we delegate this access to another stateless session bean?
I don't want to add additional overhead by adding more EJB types - but at the same time I want a scalable approach to accessing
the webservice. If we leave the WebService access to the session facade, it may get a bit cluttered and / or lose focus.

Any views on this?
 
Nilessh Ganu
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Marcelo Ortega wrote:I have a session facade implemented as a Stateless session bean (with Local interface).
The session facde is centralizing security and transaction management, plus some minor business logic.
It has an EntityManager which it uses for persisting / retrieving JPA Entities

My question is, given all of the responsibilities of the above session facade, should we use the same
to access a webservice (using @WebServiceRef), or should we delegate this access to another stateless session bean?
I don't want to add additional overhead by adding more EJB types - but at the same time I want a scalable approach to accessing
the webservice. If we leave the WebService access to the session facade, it may get a bit cluttered and / or lose focus.

Any views on this?


In my opinion, better to move out the @WebServiceRef to another SLSB as it's sole purpose would be to act as a WS client.
Also it will improve the scalability.
 
Marcelo Ortega
Ranch Hand
Posts: 528
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My thoughts exactly! Thanks Nilessh. Just need that extra bit of confirmation.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic