+

Search Tips   |   Advanced Search

JAX-WS application packaging


We can package a Java API for XML Web Services (JAX-WS) application as a Web service. A JAX-WS Web service is contained within a WAR file or a WAR module within an enterprise archive (EAR) file.

A JAX-WS enabled WAR file contains:

A WEB-INF/web.xml file is similar to this example:

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" 
    xmlns=”http://java.sun.com/xml/ns/j2ee”
         
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
         
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
         http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" 
         version="2.4">
</web-app>

The web.xml might contain servlet or servlet-mapping elements. When customizations to web.xml are not needed, the WAS runtime defines them dynamically as the module is loaded.

See on configuring web.xml, read about customizing Web URL patterns in web.xml for JAX-WS applications.

Annotated classes must contain, at a minimum, a Web service implementation class that includes the @WebService annotation. The definition and spec of the Web services-related annotations are provided by the JAX-WS and JSR-181 specifications. The Web service implementation classes can exist within the WEB-INF/classes or directory within a JAR file contained in the WEB-INF/lib directory of the WAR file.

We can optionally include WSDL documents in the JAX-WS application packaging. If the WSDL document for a particular Web service is omitted, then the WAS runtime constructs the WSDL definition dynamically from the annotations contained in the Web service implementation classes. You must include the @WebService, @WebMethod, @WebParam, @WebResult, and optionally the @SOAPBinding annotations if the WSDL document is omitted.

For transitioning users: In WAS V7.0, the default annotation support behavior has changed. In the V6.1 Feature Pack for Web services, the default behavior is to scan pre-Java EE 5 Web app modules to identify JAX-WS services and to scan pre-Java EE 5 Web app modules and EJB modules for service clients during application installation. For V 7.0, the default behavior is to not scan pre-Java EE 5 modules for annotations during application installation or server startup. You can preserve compatibility with feature packs from previous releases by either setting the UseWSFEP61ScanPolicy property in the META-INF/MANIFEST.MF of a WAR file or EJB module or by defining the Java virtual machine custom property, com.ibm.websphere.webservices.UseWSFEP61ScanPolicy, on servers to request scanning during application installation and server startup. To learn more about annotations scanning, see the JAX-WS annotations documentation.trns



 

Related concepts


WSDL
Web services
JAX-WS

 

Related tasks


Customizing URL patterns in web.xml for JAX-WS applications

 

Related


Specifications and API documentation
JAX-WS annotations