Further search narrows it down to Docker. It is not running locally.
After some testing Publishing is the solution.
It is only a problem when developing with a/on a non-local Docker environment it seems.
------------------------------
Vincent Wanders
------------------------------
Original Message:
Sent: Tue May 28, 2024 03:30 AM
From: Vincent Wanders
Subject: CORS error in Mobile calling Maximo Automation script from Mobile through an Rest API call
It seems to be a Role Based issue.
Publishing the app and test my code works like a charm.
Has anyone an idea why CORS is an issue on Role Based?
------------------------------
Vincent Wanders
Original Message:
Sent: Fri May 24, 2024 07:08 AM
From: Vincent Wanders
Subject: CORS error in Mobile calling Maximo Automation script from Mobile through an Rest API call
I am trying to call an API script in Maximo through making a Rest api call.
The call with SoapUI is working.
However within Mobile I get the CORS error below:
The url I use is:
var baseLink = 'https://<MY SERVER>/maximo/api/script/DAMGETSPDOWNLOADLINK?apikey=<MY KEY>&lean=1';
I tried to add some headers like:
myHeaders.append('Access-Control-Allow-Origin', 'origin');
myHeaders.append("Access-Control-Allow-Headers", "origin, X-Requested-With, Content-Type, Accept");
Still getting the error.
The interesting part is, is that the script is fired on the server.
I did put in some logging and it shows up in the SYSTEMOUT.LOG.
However the response from the script is not picked up in Mobile.
Can anyone help me with this issue?
Regards,
Vincent Wanders
------------------------------
Vincent Wanders
------------------------------