How to invoke a webservice call via AutoSys job
search cancel

How to invoke a webservice call via AutoSys job

book

Article ID: 264693

calendar_today

Updated On:

Products

Autosys Workload Automation

Issue/Introduction

Hi Team, we have a requirement to setup an AutoSys job that invokes a webservice call on another tool. I have the URL and respective payload json/xml details with user credentials to be able to invoke it. 

How do I setup in AutoSys?

$ autoflags -a
0028 LINUX ORA 12.0 01.00 4c0a308a abccompany.lnc.com abccompany.lnc.com

Environment

Release : 12.0

Resolution

Here is the job that has been tested successfully in the customer's environment:

/* ----------------- test_HTTP ----------------- */

insert_job: test_HTTP   job_type: HTTP
machine: mmmmmmmm
owner: OOOOOO
permission:
date_conditions: 0
description: "testing HTTP Post"
alarm_if_fail: 0
alarm_if_terminated: 0
invocation_type: POST
provider_url:https://abcpoc.cloud/resources/task/ops-task-launch
j2ee_no_global_proxy_defaults: 1
media_type: application/xml
compatibility: 12
retry_on_failure_details: 0
results_file_overwrite: 0
persist_output_payload: 0
persist_output_header: 0
persist_output_cookies: 0
preemptive_authentication: 0
headers: Authorization="Basic XXXXXXXXXXXXX=="
blob_input: <auto_blobt><task-launch>
      <name>Sleep 0</name>
</task-launch></auto_blobt>

Notes:

The job failed for the first few attempts.

1. Failed with connection reset
 
FAILURE         04/21/2023 08:33:57    1  PD  04/21/2023 08:33:57

    <Execution failed - Connection reset>

It's resolved by adding https.client.ssl.accept_new_ca=true in agentparm.txt.

2.  Failed with protocol_version

FAILURE         04/21/2023 20:08:37    1  PD  04/21/2023 20:08:38

    <Execution failed - Received fatal alert: protocol_version>

In spool:
Unhandled exception: Received fatal alert: protocol_version
javax.net.ssl.SSLException: Received fatal alert: protocol_version

It's resolved by adding the following in agentparm.txt:

com.ibm.jsse2.overrideDefaultTLS=true 
jdk.tls.client.protocols=TLSv1.1,TLSv1.2 
https.protocols=TLSv1.1,TLSv1.2

3. Job failed with the following in spool:

Status
------

HTTP/1.1 401
HTTP Request failed.

The password contains a '$' which needs to escaped with '\' when use base64 encryption to encrypt the password.