Using variables on the URI override is a great solution when things are already resolved. I found a need to set the URI from pre-processing. In my use case I lookup all meta data from a static variable. I have an include that is a short script to give me a number back for the environment, 1 for prod, 2 for uat, 3 for dev, 4 for dr. I use that number to offset what I look up so I can promote my entire solution from dev with production meta data and never edit any objects in production. My rest webservice preprocess looks like this:
:INC JOBI.GET_CLIENT, NOFOUND = IGNORE
01 !this include script returns 1 in prod, 2 in UAT, and 3 in Dev
02 !Use &PC_NUM# as an arg in variable lookups ie GET_VAR(("VARA.STATIC.FIREWALL.DATA", "HW", &PC_NUM#)
03 :SWITCH &$CLIENT#
04 !adding 1000 as alternate prod environment for lb dr evolution
05 :CASE 1000
06 :PSET &PC_NUM# = 1
07 :CASE 0100
08 :PSET &PC_NUM# = 1
09 :CASE 0102
10 :PSET &PC_NUM# = 2
11 :CASE 0101
12 :PSET &PC_NUM# = 3
13 :ENDSWITCH
:SET &LV_APP# = GET_VAR("VARA.STATIC.UI_JOB.DATA", "AUTH_API", &PC_NUM#)
:SET &LV_ENV# = GET_VAR("VARA.STATIC.UI_JOB.DATA", "API_ENV", &PC_NUM#)
:SET &LV_URI# = 'https://&LV_APP#.&LV_ENV#/login'
:P &LV_URI#
:PUT_ATT uriOverride = &LV_URI#
Technically I could skip the put_att and populate the override uri endpoint on the form with: &LV_URI#, but I was already in preprocessing.
A good way to find the name of the attributes for RA jobs, (REST, FTP etc) is to export them to xml and review there. The tag of the attribute will match up. <component con="0" enc="0" type="2" value="example for forum" xmlName="uriOverride"/> I put "example for forum" on object form then searched the xml for that phrase.
------------------------------
Scott Hughes
Senior Automation Engineer
Verizon
Albuquerque, NM
------------------------------
Original Message:
Sent: 12-11-2020 12:56 AM
From: Willy Alvarez
Subject: Web Service Connection Object
Original Message:
Sent: 12-09-2020 09:32 AM
From: Dirk Ehlers
Subject: Web Service Connection Object
Dear RA Rest Users,
is it possible to set the URL Endpoint with a
:PUT_ATT Script Line ?
Best regards,
Dirk
Original Message:
Sent: 10-02-2018 05:38 AM
From: Benedikt Weiler
Subject: Web Service Connection Object
Hi all,
currently i try to build up a generic JOBS with PromptSet to execute WebService REST requests.
My Questions:
Is it possible to read the URL Endpoint in the WebService ConnectionObject and put it into a Variable?
To execute the JOBS successfully i need currently following variables in my PromptSet:
1. ConnectionObject
2. URL Endpoint (server:port)
3. Recource
4. Method (get, post, ....)
In the JOBS I choose "Override URI Endpoint" and fill it with the variables of the prompset.
In the Pre_Process i do following to assign the ConnectionObject to Connection of my JOBS:
:PUT_ATT RestConnection = &RESTCONN#
:PUT_ATT Method = &METHOD#
I want to achieve that the 2. "URL Endpoint" is automatically filled, when i chosse the 1. "ConnectionObject" in the PromptSet.
Is that possible? Or is there a much better way to do this?
Thanks for your help in advance.
regards,
Ben