background image

1. Building Web Services with JAX-WS

<< Feedback | Web Service and Client with JAX-WS >>
<< Feedback | Web Service and Client with JAX-WS >>
xv
1
Building Web Services
with JAX-WS
J
AX-WS
stands for Java API for XML Web Services. JAX-WS is a technology
for building web services and clients that communicate using XML. JAX-WS
allows developers to write message-oriented as well as RPC-oriented web ser-
vices.
In JAX-WS, a remote procedure call is represented by an XML-based protocol
such as SOAP. The SOAP specification defines the envelope structure, encoding
rules, and conventions for representing remote procedure calls and responses.
These calls and responses are transmitted as SOAP messages (XML files) over
HTTP.
Although SOAP messages are complex, the JAX-WS API hides this complexity
from the application developer. On the server side, the developer specifies the
remote procedures by defining methods in an interface written in the Java pro-
gramming language. The developer also codes one or more classes that imple-
ment those methods. Client programs are also easy to code. A client creates a
proxy (a local object representing the service) and then simply invokes methods
on the proxy. With JAX-WS, the developer does not generate or parse SOAP
messages. It is the JAX-WS runtime system that converts the API calls and
responses to and from SOAP messages.
With JAX-WS, clients and web services have a big advantage: the platform inde-
pendence of the Java programming language. In addition, JAX-WS is not restric-
tive: a JAX-WS client can access a web service that is not running on the Java