Chapter 24. Creating JAX-RPC Web Service Configuration File

Table of Contents

24.1. Creating JAX-RPC Web Service DD File
24.2. Creating a Web Service Mapping File
24.2.1. JAX-RPC Mapping File Contents
24.2.2. Configuring JAX-RPC Mapping File

This chapter describes how to create the standard web service deployment descriptor for JAX-RPC web services and the JAX-RPC mapping file

Java EE JAX-RPC web services require a web service descriptor called 'webservices.xml' to be included in a compressed file (WAR or JAR) that contains a Java endpoint or EJB endpoint. For an EJB endpoint, the deployment descriptor must be in the 'META-INF' directory. For a servlet based endpoint, it must be in the 'WEB-INF' directory of the WAR file.

The following is the deployment descriptor file for a web service called 'FileAttachmentService'.


The root element of the 'webservices.xml' is <webservices>, and it can contain one or more <webservicedescription> elements as required components.

The <webservice-description> element describes a group of Java classes and EJB endpoints that use the same WSDL file. A <webservice-description> element is required for each WSDL file. For example, if two different Java class endpoints each have different WSDLs in the same WAR file, there must be two <webservice-description> elements that describe each JSE.

The <webservice-description> element binds a Java EE endpoint to the WSDL port definition, DD implementation, JAX-RPC mapping file, and endpoint interface. This chapter discusses their relationships and their purpose.

The JAX-RPC mapping file helps JAX-RPC compiler, which is embedded in the JEUS web service, to determine the relationship between the WSDL document and Java interface, which represents the web service endpoint. In many cases, WSDL and Java can be mapped without a mapping file, but the JAX-RPC mapping file has been added for when explicit definitions are required.

A JAX-RPC mapping file is required whenever Java EE web service endpoint or Java EE web service client is used, and there is one JAX-RPC mapping file for each WSDL file.

The contents of JAX-RPC seems more complex and longer than other configuration files.

The following is the JAX-RPC mapping file structure.