Sunteți pe pagina 1din 14

Avaya Solution & Interoperability Test Lab

Avaya SIP Enablement Server Personal Profile Manager Sample Application Documentation - issue 1.0 Abstract
This document describes the call-flow, functionality and implementation of a sample application that accesses the web services based Personal Profile Manager (PPM) API on the Avaya SIP Enablement Services server. PPMAPP is a web-based application that consists of HTML and Java Server Pages (JSP) scripts. The PPM API Web Services calls are made using JSP and the information obtained is displayed using HTML. Java Script tags are used to transition between pages. It is assumed that users have a working knowledge of HTML, JSP and Javascript in order to utilize this sample application.

KC; Reviewed: SPOC 5/2/2007

Solution & Interoperability Test Lab Application Notes 2007Avaya Inc. All Rights Reserved.

1 of 14 PPMapp

Table of Contents
1. 2. 3. 4. Introduction................................................................................................................................. 3 Equipment and software used: .................................................................................................... 4 Accessing the SIP Enablement Server (SES) Web Service Definition Language File .............. 5 Using the WSDL2Java utility ..................................................................................................... 6 4.1. Creating java class files ...................................................................................................... 7 5. Installing the PPMAPP application on Tomcat .......................................................................... 8 6. Adding Files to the PPMAPP application................................................................................. 10 7. References................................................................................................................................. 13

Table of Figures
Figure 1: Network configuration for testing PPMAPP application .................................................... 3

Table of Tables
Table 1: Equipment and Software version information...................................................................... 4 Table 2: Description of PPMAPI application ................................................................................... 12

KC; Reviewed: SPOC 5/2/2007

Solution & Interoperability Test Lab Application Notes 2007Avaya Inc. All Rights Reserved.

2 of 14 PPMapp

1. Introduction
The PPMAPP sample application demonstrates the following: 1. Use the WSDL2Java utility provided by Apache Axis to build java proxy files from the PPM WSDL file. 2. Perform Basic SSL authentication with the Personal Profile Manager (PPM) database on the SIP Enablement Services (SES) server using the PPM object. 3. Use the Contact List set of APIs exposed by the PPM web services to add, delete and view contacts for an Avaya SES user. Figure 1 below shows the network configuration for testing the PPMAPP application.

Avaya SIP Enablement Server

Ethernet

Client Machine with a web browser for accessing PPMAPI application

Tomcat Web server Hosting the PPMAPI application

Figure 1: Network configuration for testing PPMAPP application The configuration shown above is used only for test purposes. A practical deployment scenario could involve the client machine in a users network accessing the web server located in a DMZ through the internet. The Avaya SES in this scenario will be located in a remote private network and accessed by the web server through a firewall device.

KC; Reviewed: SPOC 5/2/2007

Solution & Interoperability Test Lab Application Notes 2007Avaya Inc. All Rights Reserved.

3 of 14 PPMapp

2. Equipment and software used:


Table 1 shows the equipment and software version information
Equipment Software

Avaya SIP Enablement Services (SES) server on a S8500B Media Server Dell Blade Server for Web Server Pentium 4 2 GB RAM 40 GB+ Hard Disk 100 MHz network interface card

Release 3.1 Windows 2000 Professional Service Pack 4 Avaya WebLM 4.0 Apache Tomcat Web Server 5.0.28

Table 1: Equipment and Software version information

KC; Reviewed: SPOC 5/2/2007

Solution & Interoperability Test Lab Application Notes 2007Avaya Inc. All Rights Reserved.

4 of 14 PPMapp

3. Accessing the SIP Enablement Server (SES) Web Service Definition Language File
The SES WSDL can be viewed through the web browser of any machine connected to the SES (either in a LAN or remotely) by typing: http://<IP address of the SES>/axis/services/PPM?wsdl The entire PPM interface is described in this Web Services Description Language (WSDL) document. The WSDL document lists the operations defined by the PPM interface. The parameters of each of these operations and the transport specifics are also listed as shown in below.

The PPM WSDL file is automatically deployed during the SES install process. No additional steps are necessary to configure the PPM web services post install.
KC; Reviewed: SPOC 5/2/2007 Solution & Interoperability Test Lab Application Notes 2007Avaya Inc. All Rights Reserved. 5 of 14 PPMapp

4. Using the WSDL2Java utility


Avaya SIP Enablement Server (SES) 3.1 uses Axis 1.4 to host the PPM WSDL file. Use the WSDL2Java utility provided by Axis 1.4 for building Java proxy files (helper classes and data classes) from this WSDL file. The WSDL2Java utility is provided with the Apache Axis SOAP engine. The utility can be used from the command line to build java proxies from a given WSDL file. Perform the following steps before running this utility: 1. The JAVA_HOME environment variable must be set to the root java install directory before running this utility. 2. The CLASSPATH variable should be set to include the path to the following jar files located in the CATALINA_HOME/lib Tomcat directory: axis.jar, jaxrpc.jar, saaj.jar, commons-logging.jar, commons-discovery.jar, wsdl4j.jar. Open a command line window and type java org.apache.axis.wsdl.WSDL2Java http:// <IP address of the SES> /axis/services/PPM?wsdl The missing class <class name> warning messages generally indicate that the jar file containing the .class file was not found in the CLASS_PATH specified. For additional information on using WSDL2Java, refer to the Apache Axis web page (http://ws.apache.org/axis/) and locate the page for Axis 1.4. The output of WSDL2java is located in the same directory the command was executed. For example, if the above command was run from C:\ then the output folder will be located under the C:\ directory. In this directory, the java proxy files for the PPM WSDL are located under com\avaya\xml\service\ProfileManagement\_112004 For Example: C:\com\avaya\xml\service\ProfileManagement\_112004

KC; Reviewed: SPOC 5/2/2007

Solution & Interoperability Test Lab Application Notes 2007Avaya Inc. All Rights Reserved.

6 of 14 PPMapp

4.1. Creating java class files


Open a command line window and navigate to the directory where the java proxy files are located as shown above. Type: <JAVA_HOME >/bin/javac cp .\ *.java For Example: C:\Program Files\Java\jdk1.5.0_06\bin\javac cp .\ *.java The above command will generate the corresponding class files in the same directory as the java proxy files. For additional options, refer to the javac command line help

KC; Reviewed: SPOC 5/2/2007

Solution & Interoperability Test Lab Application Notes 2007Avaya Inc. All Rights Reserved.

7 of 14 PPMapp

5. Installing the PPMAPP application on Tomcat


This sample application uses Tomcat 5.0.28 installed on a Windows 2K system with SP 4. Select any build of Tomcat 5.0 that supports Axis 1.4. The steps described below are required to build the directory structure for a standard web application. For additional details refer to Tomcat documentation. For Example: http://<IP address of Tomcat Server>:8080/tomcat-docs/. Locate the webapps folder under the Tomcat home (CATALINA_HOME) directory. Create a folder called PPMAPP under the webapps folder. An example directory path is: C:\Program Files\jakarta-tomcat-5.0.28\webapps\PPMAPP Create another folder named WEB-INF under the PPMAPP folder. Create the classes folder under the WEB-INF directory and copy the class files along with the entire directory hierarchy generated by the WSDL2Java. This is not necessary but it maintains the integrity of the directory structure as defined in the J2SE architecture. It is also recommended to create a default web.xml file containing only the Document Type Definition (DTD) describing the web.xml file and an empty </webapp> element. Navigate to the conf folder under Tomcat Home (CATALINA_HOME) Directory and open the tomcat-users.xml file. Append the lines below to the file inside the </tomcat-users> element. <role rolename="manager"/> <user username="admin" password="" roles="admin,manager"/> Save and close the file. Start Tomcat and access the Tomcat web interface by typing http://<IP address of Tomcat Server>:8080. Click on the Tomcat Manager Link as shown below.

KC; Reviewed: SPOC 5/2/2007

Solution & Interoperability Test Lab Application Notes 2007Avaya Inc. All Rights Reserved.

8 of 14 PPMapp

Type admin in the User name: field and leave the Password: field empty. Click the OK button to login to the Tomcat manager.

The context path link to the PPMAPP application should be visible under the path column as shown below. The string in the Display Name field is entered in the <display-name> tag in the web.xml file.

KC; Reviewed: SPOC 5/2/2007

Solution & Interoperability Test Lab Application Notes 2007Avaya Inc. All Rights Reserved.

9 of 14 PPMapp

6. Adding Files to the PPMAPP application


1. The code for this sample application has been developed using a notepad (.txt) editor. 2. All the files are located under the PPMAPP folder. 3. Function signatures are not listed below. Refer to [1] for additional information. Table 1 below lists the files used in the PPMAPP application and the functionality provided by each file. File Name spim.html spim_login.jsp PPM API used None getHomeServer getTransportDataInfo getPpmServer getSipServer getSipDomain getTransportList getNoOfElements getTransportName getTransportPort Functionality Display the login and password screen This page creates the PPMSoapBindingStub object. Authentication with the SES is performed using Basic Authentication over a HTTPS connection. The URL location of Home (SES) Server, SIP Server, SIP Domain and server hosting the PPM web service is obtained. Obtain the list of transport protocols supported by the SES. Iterate and display each protocol and the corresponding port number. The session.setAttribute method is used to pass the PPMSoapBindingStub object and the users primary handle between forms. The user_actions.html page is invoked by clicking the OK button on this page. Displays a page asking the user to select from the following operations: 1. Add a New Contact 2. Delete an Existing Contact 3. View Contact List Display a HTML form with fields to enter a contacts handle, name, alias, email address etc. This form can accept up to six different phone numbers for a contact. The add_contact.jsp page is invoked by clicking the Add Contact button on this page. This page invokes the PPMSoapBindingStub object using the session.getAttribute method. The contacts information is then added to the PPM database by creating a ContactData object and using the methods in the previous column. An array ContactPhoneData objects is created and the phone numbers of the contact are stored in each subsequent array. The array of ContactPhoneData objects is stored in the ContactData object for that contact. The information for a single contact is updated at a time.
10 of 14 PPMapp

user_actions.html None

add_contact.html

None

add_contact.jsp

setAddress setName setAlias setGroup setParentGroup setEmail setNotes setType setPhoneNumber setPrefixTelNumber

KC; Reviewed: SPOC 5/2/2007

Solution & Interoperability Test Lab Application Notes 2007Avaya Inc. All Rights Reserved.

Continued,

KC; Reviewed: SPOC 5/2/2007

Solution & Interoperability Test Lab Application Notes 2007Avaya Inc. All Rights Reserved.

11 of 14 PPMapp

File Name PPM API used dispcontact_delete.jsp getContactList getNoOfElements getContactInfo getName() getAddress()

delete_contacts.jsp

get_contactlist.jsp

error.jsp

Functionality This page displays the users contacts in the PPM database. The PPMSoapBindingStub object using the session.getAttribute method. The getContactList method returns the ContactListInfo object. This object contains the number of elements in the list and an array of ContactData objects. The name for each contact is obtained using the getName method and displayed on the form. The user can select a checkbox next to each name to delete that contact. The form permits selecting multiple checkboxes. Click on the Delete these contacts button to confirm. The displist form on this page will be submitted to the delete_contacts.jsp page. This page iterates through the checkboxes selected in deleteContact the above form and deletes each contact by retrieving getValue the address of each contact (passed as a hidden field from the dispcontact_delete.jsp form). A delete confirmation is displayed for each contact and the page automatically (after 1 second) displays the user_actions.html page. The get_contactlist.jsp page retrieves and displays the getContactList getNoOfElements name; email and address (handle) information for each contact. The contacts are obtained using the getContactInfo getContactList method. getName getEmail getAddress None This page is invoked from the catch block of the rest of the pages in this application. The exception message is passed to this page. The error page displays this message and automatically (after 1 second) displays the login (spim.html) page prompting the user to re-login. Table 2: Description of PPMAPI application

Cookies should be enabled on the machine accessing the PPMAPP application (through the web browser). If this is not possible due to security reasons, then the code in the .jsp pages above should be changed to support URL rewriting. This is necessary for the session object to access the PPMSoapBindingStub object in subsequent pages. Refer to your respective Web Browser vendors documentation for enabling cookies.

KC; Reviewed: SPOC 5/2/2007

Solution & Interoperability Test Lab Application Notes 2007Avaya Inc. All Rights Reserved.

12 of 14 PPMapp

7. References
The following document can be downloaded from http://devconnect.avaya.com [1] Interface Specification Document for Personal Profile Manager Document ID: 03-601678, Issue 1, August 2006

KC; Reviewed: SPOC 5/2/2007

Solution & Interoperability Test Lab Application Notes 2007Avaya Inc. All Rights Reserved.

13 of 14 PPMapp

2007 Avaya Inc. All Rights Reserved. Avaya and the Avaya Logo are trademarks of Avaya Inc. All trademarks identified by and are registered trademarks or trademarks, respectively, of Avaya Inc. All other trademarks are the property of their respective owners. The information provided in these Application Notes is subject to change without notice. The configurations, technical data, and recommendations provided in these Application Notes are believed to be accurate and dependable, but are presented without express or implied warranty. Users are responsible for their application of any products specified in these Application Notes.

Please e-mail any questions or comments pertaining to these Application Notes along with the full title name and filename, located in the lower right corner, directly to the Avaya DeveloperConnection Program at devconnect@avaya.com.

KC; Reviewed: SPOC 5/2/2007

Solution & Interoperability Test Lab Application Notes 2007Avaya Inc. All Rights Reserved.

14 of 14 PPMapp

S-ar putea să vă placă și