Chapter 7. Web Services and Java Application Servers

This chapter examines how web services can be deployed using a JAS, the software centerpiece of enterprise Java. The current version of enterprise Java is Java EE 6, which includes EJB 3.x. Yet if web services, REST-style and SOAP-based alike, can be published straightforwardly using the production-grade web servers such as Tomcat and Jetty, why bother with a JAS at all? The chapter also delves into the reasons why a JAS might be preferred over a standalone web server such as Tomcat or Jetty. To begin, an overview of available JASes might be useful.

Apache Geronimo
This is an open source project.
Apache TomEE
This is essentially the Tomcat7 web server with OpenEJB extensions. This chapter includes a code example of a SOAP-based service deployed as a @Stateless Session EJB and using JPA to persist data in an HSQLDB database. The service is deployed under TomEE as a standard WAR file—indeed, as a WAR file that requires no web.xml document.
IBM WebSphere
This is a JAS with various extensions. There is a free version for developers.
JBoss
This JAS has been a community-based project and a JAS innovator from the start. It is currently under Red Hat.
GlassFish
This JAS is part of the community-based GlassFish Metro project, which includes the Metro implementation of JAX-WS. GlassFish is the reference implementation. This chapter includes a pair of examples that involve GlassFish, including a SOAP-based service deployed as a ...

Get Java Web Services: Up and Running, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.