[8.5.5.7 or later]

Creating SIP servlets

Use the New SIP Servlet wizard to create a Session Initiation Protocol (SIP) servlet. A SIP servlet is a Java-based application component that performs SIP signaling and is run by a Java-enabled SIP application server.

Before you begin

Before you create a SIP servlet, you must complete these tasks:
  • Create a SIP project.
  • Change to the Web development perspective.
Tip: [WebSphere® Application Server traditional] For SIP projects targeted to WebSphere Application Server, on the SIP preferences page (Window > Preferences > SIP > WebSphere Application Server), ensure that Always update the deployment descriptors is selected so that the web deployment descriptor (web.xml) is updated with the new servlet that you create.

Procedure

To create a SIP servlet:

  1. In the Enterprise Explorer view, right-click the project where you want to add a SIP Servlet, and then click New > Other.
  2. Open the SIP folder, click SIP Servlet, and then click Next.
  3. On the first page of the wizard, either enter a Java™ package and class name, or select an existing servlet class or JSP, and click Next. Typically, the superclass is javax.servlet.sip.SipServlet.
  4. On the second page of the wizard, enter deployment information such as the description, initialization parameters, and any servlet mappings.
    Screen capture of second page of Create SIP Servlet wizard for SIP 1.0.
    For SIP 1.1 servlets, you can select to use this servlet as the main servlet.
    Screen capture of second page of Create SIP Servlet wizard for SIP 1.1.
    Click Next.
    Tip: You can change deployment information later by using the deployment descriptor editor.
    [8.5.5.8 or later]Important: The following information applies when you create a SIP servlet in a SIP 1.1 project with Web 3.0 and later facets:
    • All servlets that are created by the wizard have the @SipServlet annotation.
    • If you select Use this Servlet as the Main Servlet, WebSphere Developer Tools creates an annotated SIP servlet and a package-info.java file. This file contains the @SipApplication configuration for the main servlet. When you start the Create SIP Servlet wizard again, you cannot specify any servlet selection options, because only one main servlet can be in a SIP application.
    • If you select Specify Servlet Mappings, WebSphere Developer Tools creates a non-annotated SIP servlet and then configures it in the sip.xml file.
  5. On the final wizard page, specify the modifiers, interfaces, and method stubs you want to generate and click Finish.
  6. If you are prompted to update the Web deployment descriptor, click Yes.
    Tip: [WebSphere Application Server traditional] For SIP projects targeted to WebSphere Application Server, if you click No, or if you turned off the preference to always update the deployment descriptors, then you can update the Web deployment descriptor (web.xml) file later. (Right-click the sip.xml file and click SIP Operations > Update web.xml).

Results

The wizard creates the new servlet in the specified source folder and opens it in the Java editor.
Icon that indicates the type of topic Task topic
Timestamp icon Last updated: July 17, 2017 21:58

File name: creatingasipservlet.html