Questions about Publish RESTful Web Services

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
Rieko Saitoh
Posts: 58
Joined: Sat Apr 30, 2016 11:46 am

Questions about Publish RESTful Web Services

Post 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
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: Questions about Publish RESTful Web Services

Post 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
pkoopmanpk
Posts: 49
Joined: Wed Apr 26, 2017 7:12 pm

Re: Questions about Publish RESTful Web Services

Post 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.
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: Questions about Publish RESTful Web Services

Post 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
marcel.heij
Posts: 15
Joined: Thu Aug 15, 2019 4:35 pm

Re: Questions about Publish RESTful Web Services

Post 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?
Dominik
Posts: 21
Joined: Fri Jun 10, 2016 12:14 pm

Re: Questions about Publish RESTful Web Services

Post 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.
marcel.heij
Posts: 15
Joined: Thu Aug 15, 2019 4:35 pm

Re: Questions about Publish RESTful Web Services

Post by marcel.heij »

Thanks, much better with this vital argument!
Post Reply