Servlet Configuration File: web.xml
The <servicecontextname>_web.xml file includes servlet configuration information. This includes
*a definition of the servlet
*the name of the configuration file that defines the particular service (or services) that the servlet uses
*other optional parameters
When you deploy your service, HydraExpress copies all config files, including this <servicecontextname>_web.xml file to the appropriate context directory in your <installdir>\apps\servlets directory.
For more information on this file and defining servlets, see About the Servlet Used by the Service.
Following is the contents of dayofweek_web.xml.
<servlet-name>DayOfWeekPortService</servlet-name> 1
<param-name>configFile</param-name> 2
<param-name>serviceName</param-name> 3
<param-name>wsdlFileName</param-name> 4
<servlet-mapping> 5
//1 The element servlet contains an attribute <servlet-name> identifying the name of the servlet that is the entry point to the service, DayOfWeekPortService, an instance of rwsf::WebServiceServlet, the class from which all Web services in HydraExpress are derived.
//2 DayOfWeekPortService is initialized using three initialization parameters, which are defined in <init-param> elements. The first is the configuration file, or configFile, for the servlet, identified as <servicecontextname>_handlers.xml. This configuration file defines the message handler chains for the service. (The file <servicecontextname>_handlers.xml is located in both the code generation directory and in the deployment directory for the service: RWSF_HOME\apps\servlets\<servicecontextname>.)
//3 Defines the service name to use in <servicecontextname>_handlers.xml. Note that the serviceName attribute DayofWeekPortService above maps to the name attribute in the <servicecontextname>_handlers.xml file. (See Service Chains Configuration File: handlers.xml.)
//4 The optional parameter wsdlFileName simply specifies the name of the WSDL file that defined this service. If the parameter is specified, an HTTP GET request sent to the service’s URL (the SOAP address in the WSDL) returns the WSDL file. (The WSDL file is located in the directory RWSF_HOME\apps\servlets\<servicecontextname>.)
//5 The url-pattern element within a servlet-mapping element associates a servlet with a set of URLs. When a request arrives, the Agent uses a simple procedure for matching the URL in the request with a url-pattern in the web.xml file. See “Mapping Servlets to URLs,” in the HydraExpress Servlet Development Guide for more information.
The excerpt here shows the default configuration elements contained in the generated <servicecontextname>_web.xml file. Other optional configuration elements may be added to define session timeout values and to configure error pages.
For more information on setting a timeout value for your session, seeConfiguring Session Timeouts. For more information, on error pages, see “Configure Error Pages,” in the HydraExpress Servlet Development Guide.