aspose file tools*
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes calling Web Service from JSF Managed Bean v/s Session Bean 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 » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "calling Web Service from JSF Managed Bean v/s Session Bean" Watch "calling Web Service from JSF Managed Bean v/s Session Bean" New topic
Author

calling Web Service from JSF Managed Bean v/s Session Bean

Rajan Choudhary
Ranch Hand

Joined: Mar 17, 2011
Posts: 196
1) Can anybody please share Pros/cons (In an EJB centric application) of calling an intranet, light & synchronous web service from web tier v/s stateless session bean?

I can start with my understanding: putting web service call in SLB would help in scaling the solution whereas calling from web tier is handy and saves the trip to business logic tier in some cases so I would prefer to call from web tier specially when performance is the key.
What if performance and scalability both are keys?

2) Same question for putting the messages on JMS Queues/Topics: from web tier or SLB. I would do it directly from web tier and process the messages in EJB tier.

Please contribute.
Rajan Choudhary
Ranch Hand

Joined: Mar 17, 2011
Posts: 196
Anybody to share the thoughts?
giuseppe fanuzzi
Ranch Hand

Joined: Sep 18, 2006
Posts: 99
hi Rajan,
i think that adding an additional layer, like EJB, for read-only web service data, if there are no strong messaging, security and transactional requirements, could be uselessly weighty.
in this scenario not using EJB:
- it not affects the scalability (data are not stored in session, right?)
- it affects very the performance (calling web service directly from JSF or servlet)


GiUsEpPe (SCJP, SCWCD, SCBCD, IBM OOAD, SCEA/OCMJEA 5)
Rishi Shehrawat
Ranch Hand

Joined: Aug 11, 2010
Posts: 218

I agree that unless there are transactional or security requirements that warrant use of EJB, using them would actually will add to performance overhead.

Just to maintain seperation of concerns i feel that you can have a POJO based service layer & web service can be called by the service layer.
Sharma Ashutosh
Bartender

Joined: Apr 06, 2001
Posts: 346
Start thinking this way:
1) Is the BDM is good enough or you want to make slight modifications into it?
2) Once the step # 1 is done design Service Facade and Service layer.

From step # 2, decide whether your Service Facade/Service makes a call to DAO(to do CRUD operations) or talks to another interface(via client it could be WS client or RMI client or anything else).

I took this approach and within 2 weeks i had a very high level SuD in front of me(Class diagram and Component diagram) which i worked further and completed the assignment.


Ashutosh Sharma
SCJP 1.2, SCEA 5, Brainbench certified J2EE Developer, Documentum Certified Professional
Blog : http://scea5-passingpart2and3.blogspot.com/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: calling Web Service from JSF Managed Bean v/s Session Bean
 
Similar Threads
Can i have threads created in EJB Session Bean
Caching SFSB handle
Where to keep the session data
Need Help Ranchers..EJB questions?
Web Services for EJB Session Beans