File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes EJB3.0 + web services Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB3.0 + web services" Watch "EJB3.0 + web services" New topic

EJB3.0 + web services

J Guinit

Joined: Jun 13, 2011
Posts: 2
EJB3.0 newbie and hoping someone may be able to help.

Currently looking at creating a new service that has a requirement to have both Restful and SOAP WS interfaces available. I'm wondering if this is possible in EJB3.0 or does anyone have a better solution ?

Also, if using this can I deploy in Jetty (can I embed it ?) or would JBoss be more suitable ?

Piotr Nowicki
Ranch Hand

Joined: Jul 13, 2010
Posts: 610

Creating WS from an EJB is quite easy and all you need is add few annotations. The point is that the EJB container must support JAX-WS and, as far as I remember, this specification implementation (JAX-WS) is required only in Java EE 6 Full Profile. The Web Profile is not enough and I think that Jetty is not even a Web Profile server but just a servlet container.

You've got following options:
- use a full profile Java EE server like Glassfish,
- use a web profile Java EE server like JBoss (which, I think!, adds the JAX-WS implementation to their server),
- use plain servlet container like your Jetty and add an OpenEJB container (which supports JAX-WS).

Hope that helps!

J Guinit

Joined: Jun 13, 2011
Posts: 2
Thanks for the reply.

If I use an application server such as JBoss can the EJB3.0 annotations be used to specify both Restful services and SOAP services. I'm looking to have alot of simple service checks that would be restful and some complex transactional services that I read would be more suited to SOAP. Would this be correct ?
I agree. Here's the link:
subject: EJB3.0 + web services
It's not a secret anymore!