WebService Rest Job's URI value encodes question mark (?) character to "special characters"
search cancel

WebService Rest Job's URI value encodes question mark (?) character to "special characters"

book

Article ID: 213407

calendar_today

Updated On:

Products

CA Automic Applications Manager (AM) CA Automic One Automation

Issue/Introduction

If a WebService REST login object's URI value contains a URL that has a question mark (?), during runtime the Webservice Agent encodes the question mark to the value '%3F', which causes the Job to Abort. See below example:

Example URI value

http://www.test.com/coresuite/test/jobs/executions/106.json?includeLogs=false

Error in output

WebServiceRest 4.5.2+build.547 CA Inc. Secure Application Development
Start time: 4/20/21 10:35 AM
Run ID: 18729
Job: TEST

****************************************** Start of job log ******************************************
Connect timeout set to 30 seconds
Read timeout set to:60
Using connection:TEST
Authentication type:Basic
Request:GET http://www.test.com:8080/coresuite/test/jobs/executions/106.json%3FincludeLogs=false
Request headers:{Content-Type=[application/json]}

[omitted portion of output]

An error occured - processing the response query
Response query parse error: There was an error executing the query to retrieve variables from the response.
First part of the response being processed:<!DOCTYPE html PUBLI
Error from the execution of the query:
ERROR Cannot execute query.
java.lang.IllegalArgumentException: Invalid container object
Used script:
$.jobExecution.status
******************************************* End of job log *******************************************
Job Aborted: : There was an error executing the query to retrieve variables from the response.
First part of the response being processed:<!DOCTYPE html PUBLI
Error from the execution of the query:
ERROR Cannot execute query.

 

Environment

Release : 9.3

Component : APPLICATIONS MANAGER, Automation Engine REST API 4.5.2

Cause

Known defect  in RA WebService REST 4.6.0 and earlier.

 

Resolution

Fixed in RA.Web.Service.REST 4.6.1.

Workaround

Use Query Parameters to append the required value to the URI Endpoint value. For example:

1. Change the URI value:
From -http://www.test.com/coresuite/test/jobs/executions/106.json?includeLogs=false
To - http://www.test.com/coresuite/test/jobs/executions/106.json

2. Edit the Job, go to the Headers & Query Parameters

3. Add a new Query Parameter using the following value:
Parameter - includeLogs
Value - false

Notice that the URI Endpoint value will change:
From -http://www.test.com/coresuite/test/jobs/executions/106.json
To - http://www.test.com/coresuite/test/jobs/executions/106.json?includeLogs=false