Page 1 of 1

How to debug Web API's?

Posted: Thu Nov 10, 2022 4:52 am
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?

Re: How to debug Web API's?

Posted: Thu Nov 10, 2022 5:24 am
by adale

Re: How to debug Web API's?

Posted: Thu Nov 10, 2022 6:00 am
by pkoopmanpk
Thanks a lot for this pointer. I'll look into this.

Re: How to debug Web API's?

Posted: Wed Nov 16, 2022 9:44 pm
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"

},