Page 1 of 1
VL-Web session compatibility with WAM session
Posted: Mon Apr 18, 2016 1:55 pm
by marco.kam
We have an existing site built using LANSA WAMs. We would like to enhance the site piece by piece by introducing VL web.
The WAM site already uses sessions (cookies) with a specific session group name that is used over several WAMs that are part of the application. We would like to develop a new VL-Web screen that needs to fetch data from the server, but this data needs to be behind a session as it depends on the user logged in.
What would be the best way to do this sort of integration?
I was thinking that we could create a new WAM page, then modify the markup so that we could statically serve up a VL-Web page (Danny had a post in the Tips section on how to achieve this). This would secure the main WAM screen which could be under session management, but any calls to server modules made in VL-Web would not be under the same session.
Any ideas on how this could be accomplished?
Thanks,
Marco
Re: VL-Web session compatibility with WAM session
Posted: Mon Apr 18, 2016 5:30 pm
by dannyoorburg
Hi Marco,
from the WAM client you can invoke SrvRoutines via the same syntax as you can invoke WebRoutines. (Instead of WAM/Webroutine you provide the Server Module/SrvRoutine names).
If the WAM defines its session-parameters as
Code: Select all
Begin_Com Role(*EXTENDS #PRIM_WAM) Sessionkeymethod(Cookie) Sessiongroupname('MONSTER')
and the Server Module as
Code: Select all
Begin_Com Role(*EXTENDS #PRIM_SRVM) Sessionkeymethod(Cookie) Sessionidentifier('MONSTER')
then they are part of the same session and you're allowed to run a secure SrvRoutine inside a Server Module from the HTML delivered by a WAM.
That secure SrvRoutine can then deliver your VL WEB page for you, as in:
Code: Select all
Srvroutine Name(ShowPage) Response(*WEBPAGE #MYPAGE) Session(*REQUIRED)
Endroutine
You can even pass some fields/lists to it if you define the corresponding input/output maps.
I can expand on that if it's part of your requirements.
Cheers,
Danny
Re: VL-Web session compatibility with WAM session
Posted: Wed Jul 13, 2016 10:53 am
by marco.kam
Danny,
I wanted to confirm with the code that you posted below.
Does this require a particular EPC for V14?
When using the code posted for the server module we are getting an editor error message:
Component does not contain property SESSIONKEYMETHOD
Re: VL-Web session compatibility with WAM session
Posted: Wed Jul 13, 2016 1:05 pm
by dannyoorburg
Hi Marco,
yes, it requires EPC 140010.
It's CCS ID 0155186 in
http://www.lansa.com/support/notes/epc/epc140010.htm
Cheers,
Danny
Re: VL-Web session compatibility with WAM session
Posted: Fri Jul 15, 2016 12:19 pm
by faridah.belandres
dannyoorburg wrote:
from the WAM client you can invoke SrvRoutines via the same syntax as you can invoke WebRoutines. (Instead of WAM/Webroutine you provide the Server Module/SrvRoutine names).
Hi Danny,
Good day! I am trying to figure out the correct syntax to invoke the SvrRoutine from the wam/webroutine.
I wanted to call the DBDataLis/ShowPage (Server module/srvroutine) from a wam/webroutine.
I also added the Sessionkeymethod and Sessionidentifier in the BEGIN_COM line of the server module.
In the WAM's webroutine, I tried the code below but get an error: Component DBDATALIS does not contain member #DBDATALIS.ShowPage.
Code: Select all
Webroutine Name(ENTRY)
Transfer Toroutine(#DBDataLis.ShowPage)
Endroutine
Could you advise what I could check or might have missed?
Any help would be appreciated.
Thank you,
Faridah
Re: VL-Web session compatibility with WAM session
Posted: Fri Jul 15, 2016 1:34 pm
by dannyoorburg
Hi Faridah,
Note that I was talking about the WAM client-side.
Instead of navigating to the ENTRY WebRoutine from your client-side code (I guess it's a button-click), and then trying a Transfer (which indeed doesn't work between WAM's and Server Modules), try going straight to DBDATALIS/ShowPage as if it was a WAM/WebRoutine.
Danny
Re: VL-Web session compatibility with WAM session
Posted: Wed Jul 27, 2016 11:39 am
by faridah.belandres
Thanks Danny!
By the way, in the server modules, for the SessionKeyMethod property in the Begin_Com line
it seems the only available options are: Cookie, Hidden and Secure Cookie.
I noticed that there is no option for URL , but in the WAMs there is.
Would you know if it was meant to be like this or if I might have missed something?
Most of the existing WAMs in the application I'm working on uses URL for the SessionKeyMethod.
Thank you,
Faridah
Re: VL-Web session compatibility with WAM session
Posted: Thu Jul 28, 2016 11:25 am
by dannyoorburg
Hi Faridah,
it is deliberate omission.
As far as I know it doesn't add any benefits over the Session ID travelling as part of the JSON payload into a Server Routine, which is the default.
I'm happy to be proven wrong though

, if you've got a use case for it let me know...
Regards,
Danny
Re: VL-Web session compatibility with WAM session
Posted: Thu Apr 16, 2020 6:54 am
by adale
I am currently working on project as Marco originally described in this thread (complete web application built in wams over the last couple years, and now want to start utilizing the new vlweb). We are currently at V14SP2 epc142040, has there been any new updates in VL Lansa web to allow for easier transfer of control from wam to vlweb, and then from vlweb back to wam? The plan is to start slowly replacing priority pieces of the application with vlweb as we build it out, and not wait for the entire application to be re-written.