Chapter 4. SOAP-Based Web Services
JAX-WS is an API for producing and consuming REST-style and SOAP-style web services.
Chapter 2 introduced, with a RESTful example, the JAX-WS @WebServiceProvider annotation, which can be used for either
a REST-style or a SOAP-based service. This chapter introduces the @WebService annotation, in effect a refinement of
@WebServiceProvider; a @WebService is emphatically SOAP-based.
JAX-WS
is thus sufficiently rich and varied that it might better be described as a collection of APIs. JAX-WS
is the successor to JAX-RPC, which derives from the XML-RPC discussed in Chapter 1.
The reference implementation for JAX-WS is part of the open source GlassFish project and is named
GlassFish Metro or just Metro for short. The current version of JAX-WS is 2.2.x.
JAX-WS is officially part of enterprise Java but, with JDK 1.6 or greater, JAX-WS services can be compiled and published
using only core Java.
SOAP-based services in JAX-WS can be published with a standard Java web server such as Tomcat or
Jetty; there is also a convenient Endpoint publisher, used earlier to publish a RESTful service.
Apache Axis2 is an alternative implementation of JAX-WS. Axis2, the successor to Axis, is based on JAX-WS but has additional features. Yet another JAX-WS implementation is Apache CXF. This chapter focuses on the Metro implementation of JAX-WS, but the next chapter includes an Axis2 service and client. The Metro, Axis2, and Apache CXF implementations of JAX-WS are sufficiently ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access