I have send out an Application Message from IFS to an external API endpoint using a HTTP connector.
I have reaced the endpoint succesfully.
The endpoint returned me back a message and IFS is showing it to med in a .txt file.
How can I access that response, and have is saved somewhere in the database?
Any help is very appreciated.
Best answer by dsj
Elaborating the answer by
In my scenario, I’m getting the currency rates from an external API and update IFS currencies.
1: Create an event on FNDCN_APPLICATION_MESSAGE_TAB based on STATE field
Event Action: remember to add proper conditions just to trigger the action only for your integration, and state = Finished
This calls another event in a background job. Reason for taking this approach is the message reply is not commit at this time so we can’t access it directly from the event action on FNDCN_APPLICATION_MESSAGE_TAB
event_enabled_ BOOLEAN := Event_SYS.Event_Enabled('Event','CURRENCY_UPD_EXECUTE');
IF event_enabled_ THEN
event_msg_ := Message_SYS.Construct('CURRENCY_UPD_EXECUTE');
Client_SYS.Add_To_Attr('EVENT_LU_NAME_', 'Event', parameters_);
Client_SYS.Add_To_Attr('EVENT_DATA_', event_msg_, parameters_);
Transaction_SYS.Deferred_Call(id_,'EVENT_SYS.EVENT_EXECUTE','PARAMETER',parameters_,'Process cureency XML');
Script to create the
'Execute Currency XML',
Now we can create an event action for this event to do the real work.
Reply from the external web service is stored as a blob in MESSAGE_VALUE column in fndcn_message_body_tab
select MESSAGE_VALUE from fndcn_message_body_tab
where application_message_id = '&APPLICATION_MESSAGE_ID'
and REPLY = 1;
after this point, it’s converting reply to xml (or json) and process via standard plsql logic.
Hope it helps!