About the Servlet Used by the Service
In HydraExpress, services use servlets as the entry point into a container. The servlet’s default configuration values may match your needs, and you may not need to configure the servlet. If you do wish to customize servlet configuration, you may edit the service descriptor file, <servicecontextname>_web.xml which is generated for the project each time the code generator is run, and is located in your code generation directory under the conf directory. This service descriptor file includes configuration information for the service. The Agent uses the parameters in this file to launch the service at startup. For detailed information on configuring the web.xml file, see Chapter 4, “Configuring Objects in the Servlet Container,” in the HydraExpress Servlet Development Guide.
The name of the generated web.xml file is based on the <servicecontextname> which is defined by the soap:address location in the service’s WSDL document. For instance, in the following line, the context is “dayofweek” just before the service name:
<soap:address location="http://localhost:8090/dayofweek/DayOfWeek" />
The web.xml file contains several default configuration elements, and also supports additional elements that you can manually add to the descriptor file.
This section discusses the configuration elements contained in the generated <servicecontextname>_web.xml file. Other optional configuration elements may be added to configure error pages and session timeouts. For more information, see “Configure Error Pages” and “Configure Sessions” in the HydraExpress Servlet Development Guide.
Following is an excerpt from a typical <servicecontextname>_web.xml with configuration information for the service:
...
<servlet>
<servlet-name>servicecontextnameService</servlet-name> 1
<servlet-class>rwsf_webservice_servlet.createWebServiceServlet
</servlet-class>
<init-param>
<param-name>configFile</param-name> 2
<param-value>handlers.xml</param-value>
</init-param>
...
</servlet>
When you deploy your service, HydraExpress copies all config files, including this <servicecontextname>_web.xml file to the appropriate context directory in apps\servlets. See “Contexts,” in the HydraExpress Servlet Development Guide for an explanation of contexts.
When the servlet starts, it loads the config file (handlers.xml) and uses it to load the appropriate service or services. The services are now ready and waiting for requests.
For more information on handlers.xml, see Chapter 1, “SOAP Message Handlers.”