HCL Workload Automation, Version 9.4

Web services jobs

A Web services job runs a Web service of your choice. Web services jobs work only with input and output parameters that use simple data types.

A description of the job properties and valid values are detailed in the context-sensitive help in the Dynamic Workload Console by clicking the question mark (?) icon in the top-right corner of the properties pane.
This section describes the required and optional attributes for Web services jobs. Each job definition has the following format and arguments:
Table 1. Required and optional attributes for the definition of a web services job
Attribute Description/value Required
application name ws
operation The name of the web service command you are invoking.
wsdlURL The name of the web service URL.
arguments The parameters required by the web service command you are invoking (the number of values depends on the command).  
credentials The name and password of the user running this job. As an alternative to hard-coding actual values, you can parametrize in one of the following ways:
  • Enter a username specified in the database with the user definition (it is applicable to all operating systems on this job type) and key the statement:
    <jsdl:password>${password:username}</jsdl:password>
    The password is retrieved from the username user definition in the database and resolved at runtime. See Using user definitions on job types with advanced options for further details.
    You can also specify the user of a different workstation and use the following syntax for the password:
    <jsdl:password>${password:workstation#username}
      </jsdl:password>
  • Enter a user and password defined with the param utility command locally on the dynamic agent that will run the job (if the job is to be submitted to a pool or to a dynamic pool, the definition must be present on all the agents of the pool). Provided you defined the user name with the variable user and a password, the corresponding credential statements would be:
    <jsdl:userName>${agent:user}</jsdl:userName>
    <jsdl:password>${agent:password.user}</jsdl:password>
    The user and password variables are resolved on the agent at runtime. See Defining variables and passwords for local resolution on dynamic agents for further details.

If you use an HTTPS connection, ensure that the security certificates are configured for Job Manager on the workstation where the job is to run.

 

The command output is recorded in the job log.

The following example shows a task that runs the getSum Web services command. The task definition provides in the arguments section the two values that must be added.
$JOBS
AGENT#WEB_SERVICE
TASK
<?xml version="1.0" encoding="UTF-8"?>
<jsdl:jobDefinition xmlns:jsdl="http://www.ibm.com/xmlns/prod/scheduling/1.0/jsdl" 
xmlns:jsdlws="http://www.ibm.com/xmlns/prod/scheduling/1.0/jsdlws" description=
"Calls a web 
service to perform a sum of two numbers" name="SumNumber">
<jsdl:annotation>annotation</jsdl:annotation>
<jsdl:variables>
<jsdl:stringVariable description="URL of Web Service" 
name="wsdlURL">http://np515516.cyber.com:9080/
Sum/services/Sum/wsdl/Sum.wsdl</jsdl:stringVariable>
<jsdl:stringVariable description="Operation to Invoke" 
name="Operation">getSum</jsdl:stringVariable>
</jsdl:variables>
<jsdl:application name="ws">
<jsdlws:ws>
<jsdlws:wsToInvoke operation="${Operation}" wsdlURL="${wsdlURL}">
<jsdlws:arguments>
<jsdlws:value>1</jsdlws:value>
<jsdlws:value>2</jsdlws:value>
</jsdlws:arguments>
<jsdlws:credentials>
<jsdl:userName>administrator</jsdl:userName>
<jsdl:password>password</jsdl:password>
</jsdlws:credentials>
</jsdlws:wsToInvoke>
</jsdlws:ws>
</jsdl:application>
<jsdl:resources>
<jsdl:candidateHosts>
<jsdl:hostName>${host}</jsdl:hostName>
</jsdl:candidateHosts>
</jsdl:resources>
</jsdl:jobDefinition>
The following example applies if you use an HTTPS connection with the agent running the web services task. It shows how you configure the JVMOptions key in the jobManager.ini file of the agent to point to the security certificates.
JVMOptions=-Djavax.net.ssl.keyStore=/images/ITAuser/TWA/TWS/JavaExt/cfg/agentKeystore.jks 
-Djavax.net.ssl.keyStorePassword=tdwb8nxt 
-Djavax.net.ssl.trustStore=/images/ITAuser/TWA/TWS/JavaExt/cfg/agentKeystore.jks 
-Djavax.net.ssl.trustStorePassword=tdwb8nxt 
-Djavax.net.ssl.trustStoreType=JKS

By default, the timeout period for web services jobs is 90 seconds. If the web service has not completed successfully within the timeout period, the HCL Workload Automation job associated to it ends in error. To prevent jobs from failing when web services take longer than 90 seconds to complete, you can customize the timeout.

Timeout period is specified in the WSJobExecutor.properties file that is located in TWA_HOME/TWS/JavaExt/cfg directory and is structured as follows:
# Web Service timeout 
# Specify the timeout in seconds 
# Default Value is 90 seconds 
TIMEOUT=90
For example, for a web service that takes 5 minutes to complete, customize the configuration file specifying: TIMEOUT=300.

See also

From the Dynamic Workload Console you can perform the same task as described in

Creating job definitions.

For more information about how to create and edit scheduling objects, see

Designing your Workload.