Multiple Solutions with Same REST Module

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

Multiple Solutions with Same REST Module

Postby Louis.Winter » Thu Aug 13, 2020 12:40 am

Hello All,

Background:
We have 2 solutions/apps (1 for external customers the other for internal use only) that run on the same Apache Tomcat instance. I am working on putting together a dashboard to show our support reps the active users logged into these apps. I created a module with 1 form ("ActiveUsers_v1") with a ws_read() function that uses plugins.clientmanager.getConnectedClients() to get the list of users to return. When testing in the Servoy Developer with either solution the REST calls work just fine using the following url:
Code: Select all
http://localhost:8080/servoy-service/rest_ws/WS/v1/ActiveUsers


Issue:
The 2 apps run just fine in my QA environment (single Apache Tomcat instance with 2 solutions). When I try testing the new REST calls it only works for 1 of the solutions, which happens to be the first solution (I'll call it App_A). When I make the call to App_B, it returns the following:
Code: Select all
<html>

<body>No Servoy web service found for '
   rest_ws
   '</body>

</html>

I can see the headless client start in App_A but not in App_B.

I'm using Postman to test these services using the following urls:
Code: Select all
http://x.x.x.x:8080/App_A/servoy-service/rest_ws/WS/v1/ActiveUsers
http://x.x.x.x:8080/App_B/servoy-service/rest_ws/WS/v1/ActiveUsers


Do I need to configure something differently for the headless client/REST to work in both solutions?

Louis
Louis Winter
Journey Technology Solutions
Sioux Falls, SD USA
Louis.Winter
 
Posts: 24
Joined: Thu Dec 13, 2018 8:10 pm

Re: Multiple Solutions with Same REST Module

Postby ROCLASI » Thu Aug 13, 2020 9:58 am

Hi Louis.

In the Servoy wiki it says the URL is structured like so:
Code: Select all
{serverUrl}/servoy-service/rest_ws/{solutionName}/{formName}/{someValue}/{anotherValue}

I assume your form name is WS, so that would make your URLs like this:
Code: Select all
http://x.x.x.x:8080/servoy-service/rest_ws/App_A/WS/v1/ActiveUsers
http://x.x.x.x:8080/servoy-service/rest_ws/App_B/WS/v1/ActiveUsers


Hope this helps.
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: Multiple Solutions with Same REST Module

Postby Louis.Winter » Thu Aug 13, 2020 4:47 pm

Robert,

Thanks for the suggestion, I tried the format you provided and unfortunately it doesn't work for either app. Based on another post I ran across I checked the repository database and found a record for WS in the servoy_root_elements table (that was the only record in the table). I deleted this record, completely undeployed both apps, restarted Apache, and redeployed the 2 apps. This worked, the 2 URLs I was using originally both work correctly.

For what it's worth, WS is the module name and the form name is actually "ActiveUsers_v1". I believe the versioning is a relatively new feature.
Louis Winter
Journey Technology Solutions
Sioux Falls, SD USA
Louis.Winter
 
Posts: 24
Joined: Thu Dec 13, 2018 8:10 pm


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 4 guests