Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB3.0 + web services

 
J Guinit
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?

thanks
 
Piotr Nowicki
Ranch Hand
Posts: 611
1
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!

Cheers!
 
J Guinit
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic