WAS v8.5 > WebSphere applications > Web services > Web services

Web Services for Java EE specification

The Web Services for Java EE specification defines the programming model and runtime architecture for implementing web services based on the Java language. Another name for the Web Services for Java EE specification is the Java Specification Requirements (JSR) 109. The specification includes open standards for developing and implementing web services.

The Web Services for Java EE specification is based on the Java EE technology and supports the Java API for XML Web Services (JAX-WS) and (JAX-RPC) programming model for web services and clients in a manner that is interoperable and portable across application servers within environments that are scalable and secure. This specification is based on industry standards for web services, including WSDL and SOAP, and it describes the development and deployment of web services.

The application server supports the Web Services for Java EE specification, v1.3. This specification supports WSDL v1.1, SOAP v1.1 and SOAP v1.2.

We can integrate the Java EE technology with web services in a variety of ways. We can expose Java EE components as web services, for example, JavaBeans and enterprise beans. When you expose Java EE components as web services, clients that are written in Java code or existing web service clients that are not written in Java code can access these services. Java EE components can also act as web service clients.

The Web Services for Java EE specification is the preferred platform for Web-based programming because it provides open standards permitting different types of languages, operating systems and software to communicate seamlessly through the Internet.

For a Java application to act as web service client, a mapping between the WSDL file and the Java application must exist. For JAX-WS applications, the mapping is defined using annotations. We can optionally use the webservices.xml deployment descriptor to specify the location of the WSDL file and override the value defined in the @WebServices annotation. For JAX-RPC applications, you must define the JAX-RPC mapping file. To learn more about the mapping defined between the WSDL file and the web service application, see the JAX-WS specification or the JAX-RPC specification in the web services specifications and API documentation depending on the programming model used.

We can use a Java component to implement a Web service by specifying the component interface and binding information in the WSDL file and designing the application server infrastructure to accept the service request.

This entire process encompassed is based on the Web Services for Java EE specification.

The specification defines the webservices.xml deployment descriptor specifically for web services. The webservices.xml deployment descriptor file defines the set of web services that we can deploy in a Web Services for Java EE enabled container.

For JAX-WS web services, the use of the webservices.xml deployment descriptor is optional because we can use annotations to specify all of the information contained within the deployment descriptor file. We can use the deployment descriptor file to augment or override existing JAX-WS annotations. Any information defined in the webservices.xml deployment descriptor overrides any corresponding information specified by annotations.

For example, if your service implementation class for the JAX-WS web service includes the @WebService annotation as follows:

and the webservices.xml specifies a different filename for the WSDL document as follows:
<webservices> <webservice-description> <webservice-description-name>ExampleService</webservice-description-name> <wsdl-file>META-INF/wsdl/ExampleService.wsdl</wsdl-file> …
</webservice-description> </webservices>
then the value specified in the deployment descriptor, META-INF/wsdl/ExampleService.wsdl overrides the annotation value.

See section 5 of the Web Services for Java EE specification for details regarding the correlation between values specified in the web services deployment descriptor file and the attributes of the @WebService and the @WebServiceProvider annotations.

For JAX-RPC web services, you must define the deployment characteristics in the webservices.xml deployment descriptor file.

You are responsible for providing various elements to the deployment descriptor, including:

The EJB 2.1 specification also states that for a web service developed from a session bean, the EJB deployment descriptor, ejb-jar.xml, must contain the service-endpoint element. The service-endpoint value must be the same as that stated in the webservices.xml deployment descriptor.


Related concepts:

JAX-WS
JAX-RPC
WSDL


Reference:

Web services specifications and APIs


+

Search Tips   |   Advanced Search