JAX-WS is a technology for building web services and clients that communicate using XML. JAX-WS allows developers to write both message-oriented and RPC-oriented web services. JAX-WS simplifies web services compared to the older JAX-RPC standard by using annotations, a Java EE 5 innovation.
A JAX-WS web service consists of an implementation class, which is a Java class that implements the service endpoint. The implementation class defines the service endpoint interface implicitly, by default.
The implementation class is annotated with @WebService or @WebServiceProvider. The web service's operations are defined in methods in the implementation class. These methods are annotated with @WebMethod.
In Java EE 6, the JAX-WS web service can be implemented as a stateless session bean. To use an EJB with a web service in EE 5, you have to create a separate EJB module and add that module to the web application's classpath. You can combine the web application and the EJB module in an Enterprise Application.
In JAX-WS, messages to and from the web service use the XML-based protocol known as "SOAP". The SOAP specification defines the envelope structure, encoding rules, and conventions for representing web service invocations and responses. These calls and responses are transmitted as SOAP messages (XML files) over HTTP.
JAX-WS depends on the following specifications:
SOAP (Simple Object Access Protocol). Defines the mechanism by which a web service is called and how data is returned. For detailed information, refer to the SOAP 1.2 Specification.
WSDL (Web Services Description Language). Describes the external interface of a web service. For detailed information, refer to the WSDL 1.1 Specification.
UDDI (Universal Discovery, Description, and Integration). Registries contain information about web services, including the location of WSDL files and the location of the running services. The IDE does not let you publish web services to or browse from a UDDI registry, although the WSDL files that you use can come from a variety of sources, including a UDDI registry.
JAXB (Java Architecture for XML Binding). JAX-WS delegates data binding related tasks to JAXB. The JAXB 2.0/2.1 specification is developed in parallel with JAX-WS 2.0/2.1.
For more information about JAX-WS web services, see the .