Page 1 of 1

Questions about Publish RESTful Web Services

Posted: Tue Feb 26, 2019 5:12 pm
by Rieko Saitoh
Hi,

Please tell me about Publish RESTful Web Services.

1.Can I debug server modules which REST API definition is set up?

2.Is there a manual on Publish RESTful Web Services?
I confirmed the following two.
https://docs.lansa.com/14/en/lansa004/i ... 2_0040.htm
viewtopic.php?f=3&t=1915&p=4846&hilit=Publish#p4846
Please tell me if you have a more detailed manual.

Thank you.

Best regards,
Rieko Saitoh
LANSA japan

Re: Questions about Publish RESTful Web Services

Posted: Wed Feb 27, 2019 1:35 am
by jyoung
Docs are pretty lacking at the moment.

This topic may be of help some if you have not found it.
viewtopic.php?f=3&t=1915&p=5089

Regarding the debugging, you can debug, but not like you are probably used to.

I got this trick from Support while tying to debug my own services.
Part of the compilation process of a server module with an API definition is the creation of a "webmodules.conf" file in the Lansa Install /run/conf folder. That file is a simple JSON file that maps URLS to Server Module routines.

In that file you can set x_run args to enable debugging on at the module or routine level.

Code: Select all

{
  "-auto-alias": false,
   "default": {
    "language": "ENG",
    "partition": "SYS",
      "x_run_args": "DBHT=mycomputername:mydebugport"
  },

or

Code: Select all

    {
      "aliases": [
        "/A009/EchoParm/{Parm1}"
      ],
      "method": "Get",
      "module": "A009",
      "routine": "EchoParm",
      "partition": "dem",
      "x_run_args": "DBHT=mycomputername:mydebugport"
    },
Hope this helps,
Joe

Re: Questions about Publish RESTful Web Services

Posted: Tue Apr 21, 2020 12:40 am
by pkoopmanpk
Should I restart something to start debugging? I tried this, but nothing happens when I just edit /run/conf/webmodules.conf on IBMi.

Re: Questions about Publish RESTful Web Services

Posted: Tue Apr 21, 2020 1:46 am
by jyoung
You may have to restart the subsystems. I have not tried this on the IBMi, only used it on my Windows dev box.

Joe

Re: Questions about Publish RESTful Web Services

Posted: Tue Jan 19, 2021 11:52 pm
by marcel.heij
I am not getting this to work. Using Visual Lansa V15 with the latest EPC's on Windows, but nothing seems to happen after adding the suggested lines to the webmodules.conf and even restarting IIS. Are there any other steps to do or does someone have other suggestions?

Re: Questions about Publish RESTful Web Services

Posted: Wed Jan 27, 2021 6:51 pm
by Dominik
Hi marcel.heij and pkoopmanpk

Jyoung left out a vital argument in his instructions for enabling debug :)

The correct line would be
"x_run_args": "DBUG=Y DBHT=computername:debugport"

Ensure that your webserver is configured to allow interactive debugging (Web Administrator, Connect, Configure System-> Data/Application server, Miscellaneous "Allow Interactive Debugging") you would need to restart your web server after making this change.

Re: Questions about Publish RESTful Web Services

Posted: Thu Jan 28, 2021 12:52 am
by marcel.heij
Thanks, much better with this vital argument!