Gen Call External runtime using different web service URL to design time
search cancel

Gen Call External runtime using different web service URL to design time

book

Article ID: 122156

calendar_today

Updated On:

Products

Gen Gen - Run Time Distributed Gen - Workstation Toolset

Issue/Introduction

When moving from a Development environment to a QA/test environment to a Production environment, it is often required to use a different SOAP Web Service endpoint URL for the Call External statement. How can this be done for all instances of Call External being used without changing the Gen model code and regenerate/rebuild/redeploy the application?

Environment

Gen 8.5 & 8.6 "Call External" Action Diagram statement.

Resolution

1. For C generated code there is a user exit ABRT_xcall_ws_url_exit (file abrtexit.c) that allows the endpoint URL to be dynamically changed at runtime. More details here for Windows & Unix/Linux platforms:
Action Block Runtime User Exits > Windows Action Block Runtime User Exits see ABRT xcall_ws_url_exit - CALL EXTERNAL Web Service URL Exit (Windows)
Action Block Runtime User Exits > UNIX and Linux Action Block Runtime User Exits see ABRT_xcall_ws_url_exit - CALL EXTERNAL Web Service URL Exit (Unix and Linux)
NOTE: To populate a different URL string to the ABRT_xcall_ws_url_exit input/output parameter "*url" (pointer to a character array), the C function strncpy can be used. For example: strncpy(url, "new URL string", urlMaxLen);
The corresponding user exit runtime dll/shared library then needs to be rebuilt with supplied make file for the platform i.e.
Windows: IEFABEX*.DLL using make file abrtexit.nt
Unix/Linux: libabex.* using make file abrtexit.plat, where plat is the matching platform extension.

2. For Java generated code user exit WebServiceMethodCallExit.java (runtime WebServiceMethodCallExit.class) provides similar functionality with more details here:
Action Block Runtime User Exits > Java Action Block Runtime User Exit WebServiceMehtodCallExit

So using a separate copy of the user exit for each target environment enables that environment to have its own unique version of the runtime dll/shared library/java class to control the URL being used. 
Alternatively, a single user exit could be coded with some intelligence to set the URL depending on the value of some variable it can use to determine the target environment being used e.g. an environment variable.

Additional Information

The Ideation thread "Dynamic URI passing for Web services Consumption - F37692" on the CA Gen Community also discusses this topic in more detail including ideas on how to dynamically handle what url to set in the user exit when the same copy of the exit is being called multiple times by multiple executions of different Call External statements: https://communities.ca.com/ideas/235726951-dynamic-uri-passing-for-web-services-consumption.

Example scenario:
A Gen Java EJB Server Manager containing a single Procedure Step using its own copy of the Java runtimes, makes multiple Call External calls via multiple Common Action Blocks (CABs) then the correct url needs to be set for each different call. The user exit WebServiceMethodCallExit receives the default url used at design time as an input string parameter. Therefore, as long as that url string is unique for each use of Call External within the Procedure Step, the input url string value can be checked in the user exit and the correct corresponding new runtime url can be set accordingly i.e. conceptually:

if(URL == URL1)

replace URL with runtime URL1

if (URL == URL2)

replace URL with runtime URL2

etc.