This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Web-service client and Session Beans ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Web-service client and Session Beans ?" Watch "Web-service client and Session Beans ?" New topic
Author

Web-service client and Session Beans ?

Luay Abdulraheem
Ranch Hand

Joined: May 18, 2011
Posts: 65
Dear All,

Suppose that you are implementing an application that consumes web services from an external system.

Question: what is the right way to implement a web client (Proxy) in an enterprise application ? I'm asking because most of the blogs are mentioning that it should be a Backing Bean and @WebServiceRef dependency injection to obtain a reference to the service JAX-WS proxy factory class, without saying anything about using Session Beans ! And as you may all know that session beans are a major requirement in the assignment. Are session beans used in any way to consume web services ? or are they used somewhere else in the middle ? Sorry, but I don't have previous experience in this particular area

Another question depending on the previous one: In the Component Diagram, should the web client (Proxy) be considered in the integration tier or somewhere else ?

Thanks in advance,


SCJP, SCWCD, OCMJEA, OCEEJBD, OCEJPAD, TOGAF® 9 Certified, OCEJWSD
Luay Abdulraheem
Ranch Hand

Joined: May 18, 2011
Posts: 65
any one?
Usman Ibrahim
Ranch Hand

Joined: May 19, 2011
Posts: 45
You can certainly consume a web service from SLSB. I would normally consume a web service from integration layer instead of presentation (Backing/Managed bean) layer.


OCMJEA; OCA (11g dba); SCJP
Luay Abdulraheem
Ranch Hand

Joined: May 18, 2011
Posts: 65
Thanks for your reply,

So what you mean that I can consume the web service from SLSB (My Proxy will be SLSB), and in the Component diagram it would be placed in the integration tier not in the business tier ?

If yes, then the question will be : implementing the web service consumer as a SLSB will be more complex and time-consuming than implementing it as a Backing Bean ?
Krzysztof Koziol
Ranch Hand

Joined: Nov 19, 2006
Posts: 133

In my design I put Adapter between system and SLSB. In the Component Diagram it will be placed in the integration tier.

The question is should I put Adapter and POJOs (not Entities) used by it in the Class Diagram or only in the Component Diagram?


SCJP 5.0, SCWCD 5.0, SCBCD 5.0, SCEA/OCMJEA 5.0
Dumitru Postoronca
Ranch Hand

Joined: May 06, 2008
Posts: 46
Krzysztof Koziol wrote:In my design I put Adapter between system and SLSB. In the Component Diagram it will be placed in the integration tier.

I believe you should think of it as a Proxy instead of Adapter. Proxy hides remoteness (your use-case) as opposed to Adapter that allows old code to be used with new classes (adapts one interface to another).
Luay Abdulraheem
Ranch Hand

Joined: May 18, 2011
Posts: 65
Bottom line: this Proxy will be implemented as a SLSB ? I will definitely show it in the Integration tier in the Component diagram, but in the Class diagram, will this class be stereotyped <<Stateless>> ?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Web-service client and Session Beans ?
 
Similar Threads
Sample Questions for 288 - Need answers
Exposing EJB as Webservice...
Webservices and Request/Response
Consuming a web service using Java
what is "Proxy"?