1. Mark Lundell
  2. PowerServer 2020 or older (Obsolete)
  3. Wednesday, 8 July 2020 21:33 PM UTC

Is there a way for a Power Server App to determine the name of the host server?  I have an app running on two servers through an F5.  When the App retrieves the URL using AppeonExtFuncs.of_GetIeUrl() it shows up as the address of the F5 and not the specific host.

Thanks for your help!

Mark Lundell Accepted Answer Pending Moderation
  1. Thursday, 6 August 2020 21:18 PM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 1

I resolved the problem with a very small C# dll, which I deployed as a .Net component.  I used the AppeonDotNetComponent object to access the dll.

Comment
  1. Armeen Mazda @Appeon
  2. Friday, 7 August 2020 00:49 AM UTC
Thanks for sharing the solution!
  1. Helpful
There are no comments made yet.
Mark Lundell Accepted Answer Pending Moderation
  1. Friday, 17 July 2020 16:29 PM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 2

Unfortunately none of these ideas are working.  Might it be possible to get to the computer name environment variable on the server hosting the session?  Or read a file on the server which would contain the server name.  I am currently using a value in the application ini file, but every time I redeploy,  the ini file has to be changed on both production servers - easy to do but annoying.

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 9 July 2020 17:23 PM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 3

Hi Mark;

   FYI: ZhaoKai's suggested code is basically what I use in my framework. Works great ...

Regards ... Chris

Comment
There are no comments made yet.
Kai Zhao @Appeon Accepted Answer Pending Moderation
  1. Thursday, 9 July 2020 02:49 AM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 4

Hi Mark,

Please try using the function getSessionByID to get the current session information, which includes the server ID. Please refer to the article below for details:
https://docs.appeon.com/ps2020/workarounds_and_api_guide/ch04s01s04.html

For example, the script below for .net server:

AppeonDotNetComponent lnvo
any la_l[]
long ll_ret
string ls_clientID

ls_clientID = appeonGetClientID()

la_l[1] = ls_clientID // actually, can be empty and this will mean "take current session ID"
la_l[2] = ""

lnvo = Create AppeonDotNetComponent
lnvo.ComponentType = "4"
lnvo.TypeLib = ""
lnvo.ClassDescript = ""

ll_ret = lnvo.of_ExecInterface ("getSessionByID",la_l)
If ll_ret = 0 Then
MessageBox("Get session info successfully.", "Session info: " + string(la_l[2]))
End If


Regards,
ZhaoKai

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Thursday, 9 July 2020 00:50 AM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 5

Just an idea:

If your DB runs on the same server as Powerserver, maybe there's a way to get it from the DB with a SELECT or some system stored procedure.

For example, Oracle: https://stackoverflow.com/questions/2366962/find-the-server-name-for-an-oracle-database

regards 

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.