How to debug Web API's?

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

How to debug Web API's?

Post by pkoopmanpk »

I get an Fatal X_RUN_EXECUTE error occurred on a If (#Operation.TryBind( #Context )).

Code: Select all

{
  "error":{
    "messages":[
      "Fatal X_RUN_EXECUTE error occurred."
    ]
  }
}
There's nothing in the X_ERR.LOG.

I read someting about debugging by adding lines to some WebAdministrator dialog, but wouldn't that put all API's into debug? I don't want a negative performance penalty for production API's.

Is there any other way to debug API's? And if so, could someone point me in the direction of that method?
adale
Posts: 210
Joined: Wed Apr 08, 2020 9:18 pm
Location: Poplarville, MS

Re: How to debug Web API's?

Post by adale »

Arlyn Dale
Servias LLC
pkoopmanpk
Posts: 49
Joined: Wed Apr 26, 2017 7:12 pm

Re: How to debug Web API's?

Post by pkoopmanpk »

Thanks a lot for this pointer. I'll look into this.
Speedlime
Posts: 43
Joined: Wed Feb 03, 2021 2:52 am

Re: How to debug Web API's?

Post by Speedlime »

You can also add this if you are using WEB API (ServerModule)

On the IFS find the webmdules.conf
/LANSA_dcxpgmlib/run/conf
webmodules.conf

find your debug details in LANSA options in IDE and get Computer name and port
Replace in argument below

"x_run_args": "DBUG=Y DBHT=PC30821:51234"

Add this in the related Endpoint in the config file you want to debug.

Example of placement
{
"aliases": [
"/BearerToken/V1/Tokens"
],
"method": "Post",
"module": "SPSMWS00",
"routine": "PostTokens",
"x_run_args": "DBUG=Y DBHT=PC30821:51234"

},
Post Reply