Show TOC

Procedure documentationCustomizing Web Service Endpoint Locate this document in the navigation structure

 

This procedure explains how you can customize the Web service endpoint's URL pattern.

Prerequisites

You have created an inside-out Web service from a Java class.

For more information, see: Creating an Inside-Out Web Service from a Java Class

Procedure

Proceed as follows to apply additional settings to the Web module:

  1. Open the web.xml file of the Web module.

  2. On the Source tab page, add the entries as shown in the code excerpt below. These changes add the servlet and servlet-mapping entries that reference the Java class and enable you to optionally customize the servlet's URL pattern.

    Syntax Syntax

    1. ...
      <display-name>ProjectName</display-name>
        <servlet>
      	<description></description>
          <!-- Free text name of the servlet, for example myServlet -->
      	<servlet-name>ServletName</servlet-name>
          <!-- The name, including the package, 
          of the Java class serving as a servlet endpoint,
          for example com.sap.demo.myServlet -->
      	<servlet-class>Package.ServletName</servlet-class>
        </servlet>
        <servlet-mapping>
          <!-- Free text name of the servlet, for example myServlet -->
      	<servlet-name>ServletName</servlet-name>
      	<!-- Free text string which identifies the URL pattern 
      	on which the servlet endpoint will be available -->
      	<url-pattern>/MyURLPattern</url-pattern>
        </servlet-mapping>
      
        <welcome-file-list>
          ...
        </welcome-file-list>
      
    End of the code.
  3. Save the file and build the project.

Proceed with other tasks of the procedure: Creating an Inside-Out Web Service from a Java Class