• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Web service client can only be SLSB / SSB

 
Bartender
Posts: 2418
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On p7 of Frit's notes,


1.1.1 Web service client
The client can only be stateless session bean or singleton session bean



I think a web service client can neither be a bean or not a bean.
That means, a web service client may not be annotated with @Stateless or @Singleton.

 
Ranch Hand
Posts: 145
8
Mac MySQL Database Java Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Himai



This is not true, sorry.

For SOAP-based web services, the client (i.e. the java code that actually handles binding, marshalling, and http communications) is typically generated from WSDL using a tool (wsimport which is bundled with Oracle SDK or wsdl2java for CXF-based services).
Along with other classes and interfaces, a client code (i.e. the code that is used to call a SOAP-based web service) is generated, and this code is neither stateless nor singleton bean. In fact, it is not EJB at all - it is an annotated POJO.
Provided that these generated client classes are available through classpath, they can be used by class of any type.

For RESTful services, any JAVA class can be the client. All you need to call REST web service is java.net.HttpURLConnection - so any class can do it, there is no restrictions.

Note that you do not need Java at all to call RESTful services, depending on HTTP method implemented they can be called from unix command line using curl or wget, or even right from web browser.
 
Himai Minh
Bartender
Posts: 2418
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi , Mike.
I agree with what you mentioned. A web service client may neither a stateless bean nor singleton bean.

Also, I guess it may be possible to have a bean as a client that calls the methods of a web service.

In Frit's notes :


A web service client can only be stateless session bean or singleton session bean.


I don't understand this quote.
 
Creator of Enthuware JWS+ V6
Posts: 3411
320
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mike and Himai,

You are both correct. What I meant is that only Stateless session beans and Singleton session beans may have web service clients.

I will update the notes, thanks!
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic