CA Gen CALL EXTERNAL using different web service endpoint URL across multiple environments

Document ID : KB000122156
Last Modified Date : 18/04/2019
Show Technical Document Details
Introduction:
When moving from a Development environment to a QA/test environment or Production environment, it is often required to use a different SOAP Web Service endpoint URL for the CALL EXTERNAL statement. Can this be done without changing the Gen model code and regenerate/rebuild/redeploy the application? 
Environment:
CA Gen 8.5 & 8.6 "Call External" Action Diagram statement.
Instructions:
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:
https://docops.ca.com/ca-gen/8-6/en/reference/user-exits/action-block-runtime-user-exits/windows-action-block-runtime-user-exits/abrt_xcall_ws_url_exit-call-external-web-service-url-exit-windows#ABRT_xcall_ws_url_exit-CALLEXTERNALWebServiceURLExit(Windows)-BuildingonWindows 

https://docops.ca.com/ca-gen/8-6/en/reference/user-exits/action-block-runtime-user-exits/unix-and-linux-action-block-runtime-user-exits/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:
https://docops.ca.com/ca-gen/8-6/en/reference/user-exits/action-block-runtime-user-exits/java-action-block-runtime-user-exits/webservicemethodcallexit

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 thread "Dynamic URI passing for Web services Consumption - F37692" on the CA Gen Community also discusses this topic in more detail:
https://communities.ca.com/ideas/235726951-dynamic-uri-passing-for-web-services-consumption