PreviousNextIndex

Working with Web Services > Creating a Web Service Operation File
 
Creating a Web Service Operation File

Web service operation files, used within a speech application project to access and use Web services, are created using the Web service Operation wizard.

Access to the Web service Operation wizard using one of the following methodologies:

Once displayed, create a new Web service operation file by completing the Wizard fields described in the following table.

After defining a Web service using the Web service Operation Wizard, Dialog Designer creates the database operation file and places it in the <ProjectName>\connectivity\wsoperations directory. Dialog Designer assigns the new database operation file a suffix of .wsop.

Creating a Web Service Operation File 

Field/Option

Description

Specify General Parameters (Wizard Page 1)

Specify Web service operation parameters.

Available Projects

Select the project for which you want to create the Web service operation file.

File Name

Name of the Web service being created.

Open file for editing

To automatically open the Web Service Operation File Editor after creating the file with the wizard, select this check box.

WSDL URL

The URL of the WSDL file for the Web service in standard HTTP or HTTPS format.

All Web services have an associated WSDL file that describes what services the Web service provides. Dialog Designer uses this WSDL information to populate the Operation field list.

Note: Dialog Designer supports only WSDL files that contain unique method signatures.

Note: Dialog Designer does not support operation overloading, or the use of methods with the same name but different parameters.

Tip: If a Web service has been previously created, Dialog Designer remembers the URL. For future Web service creations, Dialog Designer automatically populates this field with the URL. Dialog Designer keeps track of the last 20 Web services URLs used in operations.

Authentication

Select how Dialog Designer should authenticate with the Web service host. Options are:

  • No Authentication
  • Basic - Transmits the username/password pair in an unencrypted form from browser to server in the HTTP header.
  • Digest - Transmits the username/password pair encrypted from the browser to server in the HTTP header.

User Name/Password

When Basic or Digest authentication is selected, these fields are displayed. Enter a username and optionally a password for authentication.

Load operations from WSDL file

Click this button to load the Web services operations from the WSDL file.

Timeout

Sets the maximum time, in seconds, for fetching and parsing the WSDL file.

Use Document Wrapping

Multiple input and output parameters will be wrapped in a class if this option is selected.

Allow WSDL Imports

Allow the WSDL file to reference other files by using the WSDL import statement.

Operation

Select the service to be used in this operation. This assumes that the following information is known:

  • What services are offered by the Web service
  • What form the services take

Package for types

Specifies the package name for any Java beans that are generated as a result of defining a Web service operation. The default value is connectivity.ws.beans.

Mapping Input & Output Parameters (Wizard Page 2 & 3)

Map input/output parameters expected by the Web service to the values of variables in Dialog Designer. For example, for a Web service that provides a weather report, the expected input might be the name of a city; the expected output would be the weather report string (mapped to the appropriate variable).

Note: If you do not want Dialog Designer to automatically create the variables to map to the parameters, you must create custom variables before attempting to map any parameters. See Creating Variables.

Otherwise, variables can be remapped later, using the Web Service Operation File Editor. See Viewing or Editing a Web Service Operation File.

Parameter Name

Name of the input/output parameter defined in the Web service.

Parameter Type

Data type that the input/output parameter expects from Dialog Designer.

Make sure that the variable assigned to each parameter is of the correct type.

Variable Name

The variable to map to the parameter.

If a complex variable, also select a Variable Field. If a variable is selected in this field, the Auto Create option cannot also be selected.

Variable Field

Field to map to the parameter required if the variable selected in the Variable Name field is a complex variable.

Auto Create

To have Dialog Designer automatically create and name the variable mapped to the parameter, select this option.

If selected, Dialog Designer clears the Variable Name and Variable Field values, if previously set.

Use Java Obj

Indicates whether the content of the variable should be treated as a Java object to prevent Dialog Designer from mapping it.

Use this option when the structure of the data to be sent to the Web service is more complex than what can be contained within a normal variable.

When using this option, subsequently, the following steps must be taken:

  • Create the Java object and storing it in the variable, if sending the object to the Web service.
  • Write the required Java code by overriding an existing method, such as the following method:
  • requestBegin ( SCESession mySession )
  • Retrieve the Java object from the variable, if receiving the object from the Web service.

See the following example section for more information.

For more information about the Dialog Designer API and available methods, see the Dialog Designer Programmer Reference guide in the online Help system.


Example for When to Set the "Use Java Obj" Option

Use this option when the structure of the data to be sent to the Web service is more complex than what can be contained within a normal variable. For example, suppose a Web service requires an object with a structure like the following:

Dialog Designer can handle only one level of nested variables using complex variables. That means, in this example, that Dialog Designer could send only the Person, Name, Age, and Gender values. Dialog Designer could not, however, return the second level, that is, the First and Last values.

By selecting this option when creating or editing a Web service operation file, at run-time, the Person object is treated as a single Java object, including all nested values. You can use custom Java code then to send all the values for the object that are required.

When using this option, you are responsible for creating the Java object and storing it in the variable, when sending the object to the Web service. To do this, you must write the required Java code. Usually, this is done by overriding an existing method, such as the requestBegin(SCESession mySession) method. For more information about the Dialog Designer API and the methods you can use for this, see the Dialog Designer Programmer Reference guide in the online Help system.


PreviousNextIndex

©2009, Avaya Inc. All rights reserved.