Open6

Service Action's Network and Security in ODC

Junji WatanabeJunji Watanabe

There are some points that require attention when we think about Service Actions in O11.
I'll look into some of them in ODC.

Junji WatanabeJunji Watanabe
  • When called from another Server or Service Actions, how does a Service Action handle Authentication and Authorization
  • Is the URL to a Service Action fixed?
  • Does the URL sit under the path of a screen?
  • Can we know that URL through logs on the ODC Portal?
  • Can we handle Exceptions that are raised from a Service Action in a caller Action?
Junji WatanabeJunji Watanabe

We can create a Service Action that just wraps a Server Action.
Here's a sample Server Action which just adds 1 to the Input Parameter and returns it.

First, Right click on the Action, then select "Expose as Service Action".

And I got this Service Action with the same Input and Output as the Server Action.

It calls the Server Action and sets its Output Parameter as the Output Parameter of itself.

Junji WatanabeJunji Watanabe

A Service Action has the same login information as the caller App.
If we call a Service Action from a Screen and use the GetUserId Function, we get the same User Id like '81cf9d40-2160-479d-8bed-a23e82f530c4'.
If we are not logged in to the caller app, the Function will return a blank string.

Junji WatanabeJunji Watanabe

Check URLs of Service Actions by calling a Service Action from the following places and see Request_GetURL.URL.

  1. Client Action -> https://<hostname>/<AppName>/screenservices/<AppName>/<UI Flow Name>/<ScreenName>/ServiceAPI<ServiceAction Name>
  2. Server Action, which is called from a Client Action under a Screen -> https://<hostname>/<AppName>/screenservices/<AppName>/<UI Flow Name>/<ScreenName>/Action<Server Action Name>
  3. Data Action -> https://<hostname>/<AppName>/screenservices/<AppName>/<UI Flow Name>/<ScreenName>/DataAction<Data Action Name>
  4. Timer -> http://localhost:8080/moduleservices/timers/<GUID?>/execution
  5. Expose REST API -> https://<hostname>/<AppName>/rest/<REST API Name>/<REST API Method Name> In short, it's the URL for a REST API Method

And here are the URLs I can find from Trace.

  1. Client Action -> http://svc-<GUID?>:8080/serviceapi/<ServiceAction Name>
  2. Data Action -> http://svc-<GUID?>:8080/serviceapi/<ServiceAction Name>
  3. Timer -> http://svc-<GUID?>:8080/serviceapi/<ServiceAction Name>
  4. Expose RESE API -> http://svc-<GUID?>:8080/serviceapi/<ServiceAction Name>

I can't find a Trace related to Server Action calls that includes a Service Action call. The reason is that the platform samples Traces.

Junji WatanabeJunji Watanabe

I want to test the same with Public Entities, but I can't find a proper way.
So, I just tested Aggregate using Public Entity from another App on a Screen Aggregate by looking at the Developer Tools network tab.

https://<hostname>/<Consumer AppName>/screenservices/<Consumer AppName>/MainFlow/<Screen Name>/ScreenDataSet<Aggregate Name>

Notes: If I used an Aggregate to query from an Entity in another App, it ran SQL directly instead of calling a URL.