Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Creating Web services application using the Avaya Dialog Designer (ADD)

This document demonstrates the process of building and deploying a web services application using the Avaya Dialog Designer. A process of creating an Avaya Dialog Designer web services client that consumes the web service is also shown. The steps below describe building a particular type of Web services application. For a detailed description of web services refer the ADD help documentation.

Creating a Java application accessed through a web services interface


1. Open the ADD environment, Click on File in the menu bar, Click New and select Java project.

Figure 1: Selecting a Java project 2. Type in the project name, Click Next and Finish to create the project. 3. Click on File followed by New and select package. Type in a name and click Finish to create a new java package.

Figure 2: Creating a java package 4. Select the Interface option. Name and create a java interface file. A .java file that contains the interface class is created.

5. Type in the function prototypes inside the interface class. Note: Instead of creating an interface, a class file can also be created. The key difference being that Java retains the parameters names typed in a class file whereas it does not in an interface file. 6. Right click on the .java file and select the Generate WSDL.

Figure 3: generating a WSDL file

Figure 4: Selecting Build Project

Note: Before proceeding to the next step, click on File and select Save all to apply all the changes. Ensure that after saving the application is built by right clicking on the project in the Project Explorer and selecting Build project as shown in Figure 4 above. If the above step is not completed then the error message box shown in Figure 5 might be displayed.

Figure 5: Error message while generating a WSDL file.

7. The WSDL file generation screen is shown in figure 6 below. The Binding Field select RPC Encoded style (Wrapped style is also supported). Click on the Finish button to complete generating the WSDL file.

Figure 6: Generate WSDL 8. A WSDL directory is created and the generated file with a .wsdl extension is placed in that directory. 9. Right click on the generated WSDL file and click on Generate Server (and Client) to create the files for deploying to the Tomcat axis server1. The Deployment Scope is Session implying that on the server side a new object is created for each session.

Figure 7: Generate Server (and Client)

Figure 8: Client and Server configuration screen

10. The necessary files are created and added to the package directory. Open the package directory in the Package Explorer and locate the interfacenameSoapBindingImpl.java file. Click and view this file in the editor as shown in figure 9 below.

The WSDL file will be hosted on the Tomcat axis server.

Figure 9: Default implementation in the interfacenameSoapBindingImpl.java file 11. The default implementation above should be overridden by a user provided function implementation. This function(s) will be evaluated when the web service is invoked from a client application. 12. The next steps are to install Axis on Tomcat and adding Axis libraries to your project. Ensure that the java perspective is used instead of a speech perspective. In order to change or verify this, click on window on the menu options toolbar, open perspective and select java as shown in Figure 10 below.

Figure 10: Selecting java perspective. 13. Right click on the project name in Project Explorer window and select Install Axis on Tomcat as shown in figure 11 below. The message box below is displayed if the installation is successful.

Figure 11: Axis installed message box 14. Install Axis libraries for the project by selecting Add Axis Libraries. Enter a folder name In the project(lib by default) for installing the files.

Figure 11: Installing Axis on Tomcat

Figure 12: Deploying service to Tomcat

15. The next step is to deploy the service to Tomcat. Open the package directory in the Package Explorer and locate the deploy.wsdd file. Right click on this file and select Deploy Service to Tomcat.

Testing Web Services (WS) interface


Verify Axis Installation and service deployment
1. Open a web browser and type in the URL to the axis installation on the tomcat server.
For example: http://localhost:8080/axis/ 2. If the process for installing axis described in the above section was successful then the web page shown on figure 13 should be displayed. Click on the Validation link to see list of installed components. 3. Click on the List link and ensure that the web page displays the service deployed and the WSDL file for the service is displayed. Note: In order to remove an existing Axis installation, perform the following steps: Stop the Tomcat server Locate the Tomcat installation directory (For Example: C:\Program Files\Apache Software Foundation\Tomcat 5.0) Open the Webapps folder and delete the axis folder and axis.war file. Restart Tomcat. Caution: Performing the above steps will completely remove Axis installation and all services deployed on Axis.

Figure 13: Apache Axis welcome page

Testing the Java interface


1. Open the package directory in the Package Explorer and locate the Test_Client.java file. Open the file and enter in code to invoke the function call to be tested. For Example, Functional return value = packagename.functionname(parameter list); 2. Right click on the Test_Client.java file and select Run. View the output in the Console window.

Figure 14: Running Test_Client.java

Creating an Avaya Dialog Designer Client application


1. Create a Speech project. Right click on the project and select New. Choose Web Service Operation File.

Figure 16: Select Web Service Operation File 2. Copy the URL of the WSDL file location (Using a web browser access the Axis web page, Click on the List Link, Locate the service deployed and open the WSDL file. Copy this URL and paste it into the WSDL URL edit box below).

Figure 17: Connecting to a Web services application

3. Create the parameter list variables by clicking on project.variables in the flow folder. Alternatively, checking the Autocreate box automatically creates and names the variables. The same process applies to the return value variable (if any). 4. Click Finish and the web services connection details are listed as shown in Figure 18 below. This file can be located in the Navigator under the project folder, by opening the connectivity folder followed by wsoperations folder.

Figure 18: Web services operations file 5. Open the flow folder under the project, click on the main.flow and create a simple application to Use the web service. Drag and open a Data template node on to the flow. Drag a web Service Sub-flow from the palette and point it to the webservice.wsop file created above.

Figure 19: creating a web service sub-flow 6. Complete and build the sample application and test the call flow using the Avaya Voice Browser.

You might also like