go to post Utsavi Gajjar · Jul 28, 2021 Hi guys, Tagging you both for your expert advise :) @Dmitry Maslennikov @Eduard Lebedyuk Cheers, Utsavi
go to post Utsavi Gajjar · Jul 27, 2021 Thanks Dmitry:) that actually works for me too if i change my route from /patients/{patientRef} to /patients/(.*) in the dispatch class. My only problem now is that my api specification says the route is /patients/{patientRef} and because we are using the iris api/mgmnt api to auto generate rest classes based on Swagger specification, my dispatch class is auto generated based on .spec class. My .disp class also gets overwritten everytime my .spec class is recompiled. Any ideas on how to get around this? Many thanks, Utsavi
go to post Utsavi Gajjar · Jul 27, 2021 Thanks Dmitry:) that actually works for me too if i change my route from /patients/{patientRef} to /patients/(.*) in the dispatch class. My only problem now is that my api specification says the route is /patients/{patientRef} and because we are using the iris api/mgmnt api to auto generate rest classes based on Swagger specification, my dispatch class is auto generated based on .spec class. My .disp class also gets overwritten everytime my .spec class is recompiled. Any ideas on how to get around this? Many thanks, Utsavi
go to post Utsavi Gajjar · Jul 27, 2021 Thanks for the quick response Eduard. Its just the default Apache sever that comes with IRIS. How do I check/change AllowEncodedSlashes setting?
go to post Utsavi Gajjar · Jul 27, 2021 Hi Eduard, I am running in the same issue as Dan and trying out your solution in assumption that there is no other better way of handling this. Overriding OnPreDispatch doesn't seem to work for me. My URL seems decoded by then. E.g. my API URL is http://localhost:52773/mapi/admin/v1/patients/{patientReference} where patientReference contains a slash so client call would be something like http://localhost:52773/mapi/admin/v1/patients/ipm%2F3245678 In my OnPreDisptach pUrl is already decoded v1/patients/ipm/3245678 hence your solution doesn't seem to work. Am I missing something? Is there any other way of handling this? Thanks, Utsavi
go to post Utsavi Gajjar · Jul 6, 2021 Hi @Matthieu I am facing the same issue. Did you ever figured out how to catch exceptions thrown by your DTL ? Many thanks, Utsavi
go to post Utsavi Gajjar · Jul 6, 2021 Thanks Jeffrey. <alert> was it. Do you know if there is a way of catching errors in a DTL ?
go to post Utsavi Gajjar · Jul 6, 2021 Hi Tom, How do you trigger Ens.Alert from <catchall> in your Business process? Is there a marco available to do so ?
go to post Utsavi Gajjar · Jun 23, 2021 Thank you Marc and Eduard for your reply. After spending some time I figured what you both have pointed i.e the class needs to be persistent. Hi Eduard, regarding your comment around moving JSON parsing to BS, is there a reason for doing so? I have a common business service which can invoke multiple different Business processes based on a parameter. that is why it uses the common class mapi.core.msg.rq.RestBusinessServiceRequest to pass on request data to the BP and let BP do the specifics. Regards, Utsavi
go to post Utsavi Gajjar · Jun 10, 2021 Hi Nigel, Thank you for taking time out to find a solution for this.I'd certainly follow your lead. Is it possible to email me the classes at utsavi.gajjar@mater.org.au ? Thanks again. Regards
go to post Utsavi Gajjar · May 16, 2021 Hi Dmitry, Thanks for this article. Do you know how to read the Authorization Header in the `.disp` class and pass it onto the `.impl` class? As you have mentioned in the article, `.disp` class is auto-generated by `.spec` class and does get over-written everytime `.spec` class is compiled. This makes it tricky to modify the `.disp` class to add some code to get the Authorization Header. Are you aware of any other ways to get the header ? Thanks, Utsavi
go to post Utsavi Gajjar · May 11, 2021 Hi Dmitry, I am trying out the sample code you supplied. It seems that you have to supply a Secret Key in order to decode the token using ##class(%OAuth2.JWT).JWTToObject(). If I put my sample token on jwt.io , it decodes it without me having to supply the key. Can we decode the token from IRIS without having to supply the public or private key ?
go to post Utsavi Gajjar · May 10, 2021 Thanks a lot Dmitry. I will follow your example code and see if that works for me. Will update you on how I go.
go to post Utsavi Gajjar · May 10, 2021 Hi Dmitry, Thanks for your reply. Yes the OAuth2 token. I haven't setup anything for OAuth2 on IRIS end. In our case, the REST APIs we are building in IRIS are exposed to consumer apps via IAM and Azure. IAM takes care of the OAuth2 Authentication. Client Request then flows through to IRIS which is when I need to introspect the access token to read the "Scope". I came across the following method, is that something I can utlise? set sc=##class(%SYS.OAuth2.AccessToken).GetIntrospection("demoresource",accessToken,.jsonObject)
go to post Utsavi Gajjar · May 4, 2021 Hi Peter, I know its an old post but would you mind sharing what does your "do ##class(setup.rCompileAll).doit()" method or the enitre setup.rCompileAll class look like ? regards