Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
HydraExpress Web Service Development Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

23.4 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:

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 Section 4.10 "Configure Error Pages" and Section 4.11 "Configure Sessions" in the HydraExpress Servlet Development Guide.

Following is an excerpt from a typical <servicecontextname>_web.xml with configuration information for the service:

//1

The attribute <servlet-name> identifies the name of the servlet that is the entry point to the service, <MyService>Service, an instance of rwsf::WebServiceServlet, the class from which all Web service servlets in HydraExpress are derived.

//2

<MyService>Service 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 handlers.xml. This configuration file defines the message handler chains for the service. (The file handlers.xml is located in both the code generation directory and in the deployment directory for the service: RWSF_HOME\apps\servlets\<servicecontextname>.)

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 Section 2.2.2, "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 14, "SOAP Message Handlers."



Previous fileTop of DocumentContentsIndex pageNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo are registered trademarks of Rogue Wave Software, and HydraExpress is a trademark of Rogue Wave Software. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.