Web Request Common Block
Contents
- 1 Web Request Common Block
- 1.1 Name Property
- 1.2 Block Notes Property
- 1.3 Exceptions Property
- 1.4 Trust Store Location
- 1.5 Trust Store Password
- 1.6 Request Method Property
- 1.7 Uri Property
- 1.8 Condition Property
- 1.9 Logging Details Property
- 1.10 Log Level Property
- 1.11 Authentication Type Property
- 1.12 ORS Extensions Property
- 1.13 Encoding Type Property
- 1.14 Input Parameters Property
- 1.15 JSON Content Property
- 1.16 Timeout Property
- 1.17 Custom HTTP Headers Property
- 1.18 Proxy Property
- 1.19 Login Name Property
- 1.20 Password Property
- 1.21 Enable Status Property
- 1.22 Verify JSON Response
- 1.23 Result Property
The Web Request block is used for both routing and voice applications. Use to invoke any supported HTTP web request or REST-style web Service.
- It supports PUT, DELETE, GET and POST methods.
- It is based on common Web Services standards such as XML, SOAP and WSDL instead of proprietary standards that are currently being replaced.
REpresentational State Transfer (REST) is an XML-based protocol for invoking Web Services over HTTP. REST is a lighter version of SOAP, which has evolved into a more complex protocol. REST-style web services offer a less coupled paradigm whereby simpler requests and responses are used. As an example, a simple HTTP request follows the REST methodology. The Web Request block allows the user to query "RESTful" Web services.
The supported return formats for the Web Request block are:
- plain text. For workflows, the result will be returned in a JSON string with the key name result, e.g., {"result": this is a plain text result"}
- plain XML.
- JSON string. See an issue pertaining to JSON objects in Troubleshooting.
In version 8.1.450.20, the SSL certificate validation code is disabled as Composer does not utilize this code for HTTP requests. If required, this code can be enabled on a demand basis by setting the web.legacyCertificateCode option to true in the composer.properties file. In previous versions, this code was always enabled.
The Web Request block has the following properties:
Name Property
Find this property's details under Common Properties for Workflow Blocks or Common Properties for Callflow Blocks
Block Notes Property
Find this property's details under Common Properties for Workflow Blocks or Common Properties for Callflow Blocks.
Exceptions Property
Find this property's details under Common Properties for Workflow Blocks or Common Properties for Callflow Blocks You can also define custom events.
Note: For JAVA projects, the composer.properties file is found in the WEB-INF folder of the respective project. For .NET projects the composer.properties file is found in the BIN folder of the respective project. The composer.properties is not created by default by Composer, and users must create one, if required.
Trust Store Location
Use this property to specify the path to the certificate store location. The path must point to the keystore file (*.jks) or cacerts ( default trust store provided by JVM ) that contains a list of certificate(s) that the Composer application trusts. The drop-down lists the Entry block variables by default.
For Java projects, the drop-down is editable and the Java trust store can be customized and can override the default trust store location provided by the Java Virtual Machine.
- You can point to the default CA certificate residing at $JAVA_HOME/lib/security/cacerts, or
- Manually create a CA certificate file of their own (using the keytool utility) .
You can either select a variable that has the path or directly specify an absolute path.
For .NET projects, the drop-down is not editable. Windows has its own certificate store (StoreLocation.CurrentUser, StoreLocation.LocalMachine) and you cannot provide a new location or override the default location.
Trust Store Password
Use this property to specify the password to access the specified trust store.
Request Method Property
This property Indicates the method for invoking the web request:
- get--Invoked using HTTP Get.
- post--Invoked using HTTP Post.
- put--Invoked using HTTP Put.
- delete--Invoked using HTTP Delete.
To select a value for the Request Method property:
- Select the Request Method row in the block's property table.
- In the Value field, select get, post, put, or delete from the drop-down list.
Uri Property
The Uri property specifies the http:// page to invoke. To set a URL destination for the Uri property:
- Select the Uri row in the block's property table.
- In the Value field, click the down arrow and select the variable that contains URL.
Condition Property
Find this property's details under Common Properties for Callflow Blocks or Common Properties for Workflow Blocks.
Logging Details Property
Find this property's details under Common Properties for Callflow Blocks or Common Properties for Workflow Blocks.
Log Level Property
Find this property's details under Common Properties for Callflow Blocks or Common Properties for Workflow Blocks.
Authentication Type Property
The Authentication Type property specifies whether to use an anonymous or basic authentication for the web request. To assign a value to the Authentication Type property:
- Select the Authentication Type row in the block's property table.
- In the Value field, select anonymous (default) or basic from the drop-down list. With the anonymous type of access, no user name/password is passed to Web service for client authentication in order to get data. If you select the basic type of access, you must supply the Login Name and Password properties.
ORS Extensions Property
Starting with 8.1.4, Composer blocks used to build routing applications (with the exception of the Disconnect and EndParallel blocks) add a new ORS Extensions property.
Encoding Type Property
The Encoding Type property (used for callflows only) indicates the media encoding type of the submitted document. GVP 8.1 supports two encoding types:
- application/x-www-form-urlencoded
- multipart/form-data
To select a value for the Encoding Type property:
- Select the Encoding Type row in the block's property table.
- In the Value field, select one of the following:
- application/x-www-form-urlencoded (default)
- application/json
Input Parameters Property
Use the Input Parameters property to specify a list of required Name/Value pairs to pass as parameters to the http:// page. To specify input parameters:
- Click the Parameters row in the block's property table.
- Click the button to open the Parameter Settings dialog box.
Add Button Use the Add button to enter parameter details.
- Click Add to add an entry to Web Request Parameters.
- In the Parameter Name field, accept the default name or change it.
- From the Parameter Type drop-down list, select In, Out, or InOut:
In | Input parameters are variables submitted to the web request. |
Out | Output parameters are variables that the web request returns and will be reassigned back to the current callflow/workflow. |
InOut | InOut parameters are parameters that act as both input and output. |
- In the Expression drop-down list, select from among the variables shown, type your own expression, or click the button to use Expression Builder.
- In the Definition field, type a description for this parameter.
- Click Add again to enter another parameter, or click OK to finish.
Delete Button To delete a parameter:
- Select an entry from the list.
- Click Delete.
JSON Content Property
If the HTTP request to be invoked expects JSON content, this property can be used to specify that input. It expects a variable whose content will be sent to the API specified in the HTTP URI property of the block. Set the Encoding Type property of the block to application/json. In this case, the Input Parameters property will not be used.
The variable selected in this property should contain a JavaScript object. The object can be built from a JSON string, or using the ECMAScript block.
For example, if you would like to pass a JSON content to the HTTP URI, using a variable named "content", the variable can be initialized in the following ways:
- If you have a JSON string, you can use the Assign block to assign the following value to "content":
JSON.parse('{"abc": "def", "xyz": 3}')
- Alternately, you can build a JavaScript object using an ECMAScript block with code like the following:
var content = new Object(); content['abc'] = 'def'; content['xyz'] = 3;
In both cases, set the JSON Content property of the Web Request block to the variable named "content".
Timeout Property
Select the variable containing the number of seconds that the application will wait when fetching the result of the Web Service or the Web Request or keep the default of 90 (added starting with 8.1.440.18). If the requested resource does not respond in that time, then a timeout event will occur.
Custom HTTP Headers Property
Use this property to add Custom headers to be sent along with the HTTP request during the runtime execution of the Server Side block.
- Click the row in the block's property table.
- Click the button to open the Custom HTTP Headers dialog box.
- Click Add to open Configuration Custom HTTP Headers dialog box.
- Select a Header type.
- Select Literal or Variable.
- Type the literal value or select the variable that contains the value.
Proxy Property
You can specify a proxy server to act as an intermediary server when making requests for Web Services from other servers. The proxy server evaluates the request as a way to simplify and control its complexity. Today, most proxies are web proxies, facilitating access to content on the World Wide Web and providing anonymity. To configure:
- Set Enable Proxy to true or false.
- Enter the IP address of the web proxy Host.
- Enter the Password for the web proxy.
- Enter the web proxy Port.
- Enter the web proxy User Name.
Login Name Property
Used when Authentication type = basic. The Login Name property specifies the login name for the invoked web page. To provide a login name for the web request:
- Select the Login Name row in the block's property table.
- In the Value field, type a valid login name.
Password Property
Used when Authentication type = basic. The Password property specifies the password for the invoked web page. To provide a password for the web request:
- Select the Password row in the block's property table.
- In the Value field, type a valid password that corresponds to the login name above or, starting with 8.1.440.18, you can select the password from a variable.
Enable Status Property
Find this property's details under Common Properties for Callflow Blocks or Common Properties for Workflow Blocks.
Verify JSON Response
Composer 8.1.400.35 adds this property. When set to false, the Web Request block will not parse the JSON response and will return it as-is. The default is true. Add this property to the Properties view by clicking the Show Advanced Properties button.
Result Property
The Result property is the variable used to get back a result from the web request. To select a variable:
- Select the Result row in the block's property table.
- In the Value field, select one of the available variables from the drop-down list. Does not need to match the variable name that is coming back as a result of the web request.