Java Reference
In-Depth Information
server. JSF has its own JavaScript functions and server support code that make building
AJAX-enabled web pages trivial. Discussing JSF in more detail is out of the scope of this
book. Now that we've explored the basics of web services, let's dig into the traditional
SOAP-based web services using JAX-WS.
8.2. Exposing EJBs using SOAP (JAX-WS)
Starting with Java EE 7 onward, JAX-WS 2.2 is the specification standardizing SOAP web
services on the Java EE platform. Developing SOAP-based web services using JAX-WS is
straightforward and easy. Using the annotations, a web service can be written and deployed
within minutes. SOAP web service support on the Java platform has come a long way since
the early days. Before we start looking at code, we'll briefly review the basics of SOAP-
based web services.
8.2.1. Basics of SOAP
SOAP is a distributed protocol similar to COBRA and Java RMI. It enables applications
to talk to each other by exchanging messages over a network protocol, most commonly
HTTP/HTTPS. Communication is exchanged via a well-defined XML message format.
The message format is defined using a WSDL and XML schema. The use of HTTP to
exchange well-defined XML messages has resulted in the widespread adoption of SOAP
to connect disparate systems written in different languages on different platforms. For
example, using SOAP you can expose EJBs to an application written in Python, C#,
Objective-C, and the like. In addition, because SOAP is well defined, both the server and
client code can be auto-generated. Thus, SOAP-based web services have enjoyed enorm-
ous popularity.
Microsoft originally developed SOAP in 1998 and the W3C now manages the specifica-
tion. At the time of writing, the current SOAP specification is 1.2. Just as important as the
SOAP specification are the WS-I profiles. The WS-I ( www.ws-i.org ) is an industry consor-
tium that defines interoperability standards for web services. Although SOAP is language-
agnostic, issues do arise in how SOAP implementations interpret the specifications. The
WS-I produces profiles and sample applications that provide clear guidance in developing
web services that are truly compatible. The profiles pertinent to this chapter are as follows:
Search WWH ::




Custom Search