25
Views
2
Comments
Solved
Request URL to access objects in dependency module
Application Type
Mobile, Reactive, Service

Dear OutSystems experts,

I have some stupid doubts about how clients (e.g. browsers) access server actions/service actions/entities that are defined in another modules (via dependency) in terms of HTTP requests.  I tried to describe my doubts in 2 parts.

***************************************

Part 1:

Lets say I have a mobile application "MyMobileApp" with the main module and a service module "MyBL".

Inside MyBL, I have a very simple server action "MyServerAction", and Public is set to Yes.


And then, I have another web application, which imports this "MyServerAction" through dependency, and the server action is being called when a screen button is being clicked.


I have checked the IIS and found that actually all 3 modules (MyMobileApp, MyBL, MyWebApp) exist as applications under the Default Site.  Now, when a user clicks the screen button in "MyWebApp", where does the browser sends the request URL to in order to trigger "MyServerAction":

- "MyWebApp" (e.g. https://www.mycompany.com/MyWebApp/xxxxxxxxxxxxxxxxxx) or
- "MyBL" (e.g. https://www.mycompany.com/MyBL/xxxxxxxxxxxxx)?

From my understanding, even though "MyServerAction" actually exists under "MyBL", but the browser will still send the HTTP request URL to "MyWebApp", it is then the IIS internal thing to locate the corresponding server action in other modules.  If this is the case for Server Action, can I assume that the same behavior applies to other object types that can be imported via dependency, e.g.:

- Service Action
- Entities
- Structures, etc.

***************************************

Part 2:

With about above clarified, the true question that I would like to ask is, we have several non-OutSystems web applications running on different domains, e.g. 

- "https://www.mycompany1.com" , 
- "https://www.mycompany2.com", 
- "https://www.mycompany3.com", 
- "https://www.mycompany4.com/MyMobileApp"  <= this is the domain for our OutSystems installation (on-prem)

and the user wants to proxy-pass to the OutSystems application "MyWebApp" by appending the module name to all the above domains,

- "https://www.mycompany1.com/MyWebApp" 
- "https://www.mycompany2.com/MyWebApp",
- "https://www.mycompany3.com/MyWebApp"

With the above requirement, it seems to me that we can only map each of the above URLs directly to the OutSystems module "MyWebApp" in the reverse proxy, e.g.:

https://www.company1.com/MyWebApp   =>  https://www.mycompany4.com/MyWebApp

Which means that we cannot access any OutSystems modules other than MyWebApp (i.e. MyBL, ServiceCenter, etc.) using the first 3 domain URLs.

So having said all the above, I would like to know, when a user opens "https://www.mycompany1.com/MyWebApp/Screen1", and Screen1 needs to consume other objects imported via dependency, can I safely assumed that all the requests will always be made via the URL "https://www.mycompany1.com/MyWebApp"?

Sorry for such a long and cumbersome question and thanks in advance everyone.

Regards
Stanley


2019-01-07 16-04-16
Siya
 
MVP
Solution

Part 1 : 

Your understanding is correct. Even though 'MyServerAction' actually exists under 'MyBL', the browser will still send the HTTP request URL to 'MyWebApp'. It is then up to IIS to locate the corresponding server action in other modules. 

For example, I have a core service 'CustomerManagementCore' which exposes the 'CustomerCreateOrUpdate' server action. This action is referenced in another module, 'CustomerManagement', and is used in the Manager UI Flow -> CustomerDetail Screen. Here is what happens when you click on the Save action:

https://{environment}/CustomerManagement/screenservices/CustomerManagement/Manager/CustomerDetail/ActionCustomerCreateOrUpdate

Part 2 :

With a reverse proxy, you can access any application hosted in OutSystems using any domain.

UserImage.jpg
Stanley Vong

Thanks for the reply.

Just a bit more detail about my part 2 doubt - for the first three domains, we will only create proxy rule to the "MyWebApp", but not "MyBL", just like what was mentioned in the original post:

https://www.company1.com/MyWebApp   =>  https://www.mycompany4.com/MyWebApp

So if the browser needs to send HTTP request to MyBL (e.g. https://www.company1.com/MyBL) in order to access the Server Action that was added to MyWebApp via dependency, it will probably ended up with 404 error.

With the above i think i have my doubts cleared, thanks again.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.