There is an installation of CA API Gateway 8.3 where I need to schedule a SOAP method to be invoked daily.
This method requires a basic authentication.
Which kind of approach could you suggest, since this version of CA API Gateway doesn’t include any scheduler?
Many thanks, Roberto
You could use any scheduling program and trigger a webservice call.
A very basic solution would be to setup a crontab entry and trigger curl.
I had a similar issue, where the execution should be trigger by an external scheduler. Let's assume that
you can set up a powershell like I did in the following way:
Dear ronro03 ,
I would recommend you to think of upgrade the gateway to latest version, not just for the scheduled tasks feature, version 8.3 is a bit old.
If you cannot upgrade the gateway soon, I would recommend the solution from RemcoDekker .
You may create a /scheduledtask service on gateway, in this service you build the soap request with Authorization header, and route it to the down stream server:
-- you can use a new context variable for your soap request
-- you can use Manage Transport Properties/Headers Assertion - CA API Gateway - 9.3 - CA Technologies Documentation to add Authorization header (for basic authentication, the header is Authorization: Basic <base64 encoded username:password>) to your soap request context variable (right click on the assertion to "Select Target Message")
-- in the route via http assertion you specify the soap request context variable as the "Request Source"
-- then you create a cron job on gateway server to use curl to trigger the task,
for example, if you want to send soap request at 11pm every day, you may
0 23 * * * curl http://localhost:8080/scheduledtask
(compare to torlu03 's solution, we build and send the soap request in a gateway service)
I think also ronro03 should decide which method to adopt based on the objective of this scheduling. Using the cronjob, in my view, should be limited only for administrative purposes or something related to the management of CA API gateway itself. Any other business needs that must be driven by external factor should be scheduled outside (not necessary who accesses to the policy manager is the same person that can access to the appliance :-) ).
The customer finally choose to schedule this externally and demand the execution to another team.
Thanks all for the feedback.
Dear ronro03 , torlu03 ,
Using external scheduler is not a problem, but your (torlu03 's) solution doesn't require gateway -- since you bypass the gateway, you won't have any (security) benefit from gateway.
So, the question is not where to build the soap request, the question is, would you intend to use gateway to protect your backend server? Or would you allow direct connection to the backend server without gateway?
regarding my case, the scenario is a web services exposed by CA API Gateway, invoked live by a web page and invoked scheduled by a batch. There is not direct comunication with backend, because it is protected by farewall and secured by CA API gateway. What I simply did is to allow a scheduler to consume a web services already in place (without open any change request for scheduling a crontab and create a new policy for this).
I do not know if the scenario of ronro03 is the same :-)
Yes, that makes sense.