8.2.6 Editing web.xml

When developing a POJO Web service, to deploy Web Services, add the settings for operating as a Web Service in web.xml. When developing an EJB Web service, you need not edit web.xml because the EJB Web service is included in the EJB-JAR file.

The following table describes the elements to be added and the values to be specified:

Table 8-1 Elements added and values specified in web.xml

Element names in web.xmlSpecified value
web-app--

listener--

listener-classcom.cosminexus.xml.ws.transport.http.servlet.WSServletContextListener
servlet--

servlet-nameWSServlet
servlet-classcom.cosminexus.xml.ws.transport.http.servlet.WSServlet
load-on-startup1
servlet-mapping--

servlet-nameWSServlet
url-patternMapped URL#
Legend:
--: No value is specified.

#
Specify "/" + Name-attribute-value-of-the-wsdl:service-element-of-WSDL ("/" + Name-attribute-value-of-the-wsdl:service-element-of-WSDL indicates that a forward slash (/) is added at the beginning of the name attribute value of the wsdl:service element of WSDL).

A specification example is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
  xmlns="http://java.sun.com/xml/ns/javaee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
  http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

<listener>
 <listener-class>com.cosminexus.xml.ws.transport.http.servlet.WSServletContextListener</listener-class>
</listener>

<servlet>
 <servlet-name>WSServlet</servlet-name>
 <servlet-class>com.cosminexus.xml.ws.transport.http.servlet.WSServlet</servlet-class>
 <load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
 <servlet-name>WSServlet</servlet-name>
 <url-pattern>/TestJaxWsService</url-pattern>
</servlet-mapping>

</web-app>

For details on editing web.xml, see 3.4 Creating web.xml in the manual uCosminexus Application Server Web Service Development Guide.