REST Annotations
 

REST Annotations

14 posts, 2 answered
  1. Roger Blanchard
    Roger Blanchard avatar
    381 posts
    Registered:
    29 Jun 2018
    Answered
    02 Apr 2021
    Link to this post
    SCL-3330 FIxed issue resolving class names for Rest Resources when r-code is located in a PL file
    Description:
    We have fixed another issue that was causing problems parsing annotations for Business Entities and Business Tasks located in a PL file.

    Are these annoations loaded when the RestResourceService starts?

    Does this service look through PROPATH for the annotations or just the PASOE Instance working folder?

    The reason I am asking is my .annotations are not being found. We do distribute all of our .r code in procedure libraries (including a scl.pl).
  2. Daniel van Doorn
    Daniel van Doorn avatar
    17 posts
    Registered:
    18 Jun 2018
    Answered
    02 Apr 2021 in reply to Roger Blanchard
    Link to this post
    Hi Roger,

    You need a .classpath file. This file must be in the PROPATH.
    If you still have your training workspace, there is a .classpath in the <PASOE>\work 

    The annotations are loaded when the RestResourceService starts. 

    If you put the log level of the RestResouceService to 4:
    "RestResource:4" then you will see all the REST endpoints in the appserver logging like this:

    2021-03-25T13:38:14.788+0100 014488 026924 1 AS-7 ?:?:? RestResour     ### Registering REST Methods: Consultingwerk.SmartFramework.Authentication.SmartDataBrowserViewManagerBusinessTask
    2021-03-25T13:38:14.804+0100 014488 026924 1 AS-7 ?:?:? RestResour     ### Number of Methods: 7
    2021-03-25T13:38:14.804+0100 014488 026924 1 AS-7 ?:?:? RestResour     ### Registering Business Task REST Method: get       : /SmartFramework/UserProfiles/BuildProfileKey       Consultingwerk.SmartFramework.Authentication.SmartDataBrowserViewManagerBusinessTask:BuildProfileKey(Consultingwerk.SmartFramework.Authentication.BuildProfileKeyParameter) -> return
    2021-03-25T13:38:14.806+0100 014488 026924 1 AS-7 ?:?:? RestResour     ### Registering Business Task REST Method: post      : /SmartFramework/UserProfiles/BuildProfileKey       Consultingwerk.SmartFramework.Authentication.SmartDataBrowserViewManagerBusinessTask:BuildProfileKey(Consultingwerk.SmartFramework.Authentication.BuildProfileKeyParameter) -> return
    2021-03-25T13:38:14.806+0100 014488 026924 1 AS-7 ?:?:? RestResour     ### Registering Business Task REST Method: delete    : /SmartFramework/UserProfiles/{UserProfileGuid}       Consultingwerk.SmartFramework.Authentication.SmartDataBrowserViewManagerBusinessTask:DeleteView(Consultingwerk.SmartFramework.Authentication.UserProfileParameter) -> return
    2021-03-25T13:38:14.807+0100 014488 026924 1 AS-7 ?:?:? RestResour     ### Registering Business Task REST Method: get       : /SmartFramework/UserProfiles/StoredViews/{UserProfileGuid}       Consultingwerk.SmartFramework.Authentication.SmartDataBrowserViewManagerBusinessTask:GetView(Consultingwerk.SmartFramework.Authentication.UserProfileParameter) -> return
    2021-03-25T13:38:14.808+0100 014488 026924 1 AS-7 ?:?:? RestResour     ### Registering Business Task REST Method: put       : /SmartFramework/UserProfiles/StoredViews/{UserProfileGuid}       Consultingwerk.SmartFramework.Authentication.SmartDataBrowserViewManagerBusinessTask:StoreView(Consultingwerk.SmartFramework.Authentication.StoreGridViewParameter) -> return
    2021-03-25T13:38:14.809+0100 014488 026924 1 AS-7 ?:?:? RestResour     ### Registering Business Task REST Method: post      : /SmartFramework/UserProfiles/StoredViews       Consultingwerk.SmartFramework.Authentication.SmartDataBrowserViewManagerBusinessTask:StoreNewView(Consultingwerk.SmartFramework.Authentication.StoreGridViewParameter) -> return
    2021-03-25T13:38:14.809+0100 014488 026924 1 AS-7 ?:?:? RestResour     ### Registering Business Task REST Method: get       : /SmartFramework/UserProfiles/StoredViews       Consultingwerk.SmartFramework.Authentication.SmartDataBrowserViewManagerBusinessTask:GetStoredViews(Consultingwerk.SmartFramework.Authentication.UserProfileKeyParameter) -> return
    Last modified on 02 Apr 2021 12:04 by Daniel van Doorn
  3. Roger Blanchard
    Roger Blanchard avatar
    381 posts
    Registered:
    29 Jun 2018
    02 Apr 2021 in reply to Daniel van Doorn
    Link to this post
    Hey Daniel,

    Perfect......thank you. I was just reviewing the code in that service and found the reference to .classpath. 

    I do have the training workspace.

    Let me give this a shot.
  4. Daniel van Doorn
    Daniel van Doorn avatar
    17 posts
    Registered:
    18 Jun 2018
    02 Apr 2021 in reply to Daniel van Doorn
    Link to this post
    And please note that the directory locations in this .classpath file must be relative from the PASOE (or fully qualified if you wish) so it cannot be the same .classpath file as used in OpenEdge Studio usually. 
  5. Roger Blanchard
    Roger Blanchard avatar
    381 posts
    Registered:
    29 Jun 2018
    02 Apr 2021 in reply to Daniel van Doorn
    Link to this post
    That did the trick....thanks.

    Have a great weekend!!
  6. Daniel van Doorn
    Daniel van Doorn avatar
    17 posts
    Registered:
    18 Jun 2018
    02 Apr 2021 in reply to Roger Blanchard
    Link to this post
    Perfect and have a nice Easter!
  7. Roger Blanchard
    Roger Blanchard avatar
    381 posts
    Registered:
    29 Jun 2018
    02 Apr 2021 in reply to Daniel van Doorn
    Link to this post
    you as well.
  8. Roger Blanchard
    Roger Blanchard avatar
    381 posts
    Registered:
    29 Jun 2018
    02 Apr 2021 in reply to Daniel van Doorn
    Link to this post
    Daniel,

    I am trying to get swagger running by following rerencing https://consultingwerk.atlassian.net/wiki/spaces/SCL/pages/8094110/Swagger+REST+API+Documentation+for+RESTful+Services

    but the link to the swagger.zip is not valid. I copied the swagger folder from the training PAS instance into my instance but I am getting HTTP ERROR 403.

    Any ideas?



  9. Mike Fechner
    Mike Fechner avatar
    319 posts
    Registered:
    14 Sep 2016
    02 Apr 2021 in reply to Roger Blanchard
    Link to this post
    Can you please check using the Chrome Developer Tools (network tab), which URL is causing the 403 error? 
  10. Roger Blanchard
    Roger Blanchard avatar
    381 posts
    Registered:
    29 Jun 2018
    03 Apr 2021 in reply to Mike Fechner
    Link to this post
    It does not get too far.

    http://localhost:8940/web/SwaggerEntities/html
  11. Mike Fechner
    Mike Fechner avatar
    319 posts
    Registered:
    14 Sep 2016
    03 Apr 2021 in reply to Roger Blanchard
    Link to this post
    And the 403 error page, is that a green one (from Progress) or a JSON one from us? 

    Your PASOE is using Form based authentication or basic? 

    Is this the only web handler that fails? How about 

    http://localhost:8940/web/SessionInfo ?

    Have your tried using https? Form based authentication relies on a jsessionid cookie - and the browsers enforce cookies over https since a while. 
  12. Roger Blanchard
    Roger Blanchard avatar
    381 posts
    Registered:
    29 Jun 2018
    03 Apr 2021 in reply to Mike Fechner
    Link to this post
    Hey Mike,

    Thanks for answering my questions on a Saturday. They led me to what was causing the original issue. We are using OERealm for our app and I was following that article too closely. I needed to add the web app name.

    http://localhost:8940/OspreyHostBackend/web/SwaggerEntities/html

    I now get beyond that to at least calling the .r code. 

    {"title":"A runtime error has occurred","error":"Progress.Lang.SysError","message":"Invalid handle. Not initialized or points to a deleted object. (3135)","messageNum":3135,"callStack":"GetSwaggerRestfulHtml Consultingwerk.OERA.Swagger.SwaggerRestEntitiesGenerator at line 1657 (Consultingwerk\/OERA\/Swagger\/SwaggerRestEntitiesGenerator.r)\nGenerateHtml Consultingwerk.OERA.Swagger.SwaggerRestEntitiesWebHandler at line 694 (Consultingwerk\/OERA\/Swagger\/SwaggerRestEntitiesWebHandler.r)\nHandleGet Consultingwerk.OERA.Swagger.SwaggerRestEntitiesWebHandler at line 611 (Consultingwerk\/OERA\/Swagger\/SwaggerRestEntitiesWebHandler.r)\nHandleRequest OpenEdge.Web.WebHandler at line 61 (OpenEdge\/Web\/WebHandler.r)\nHandleRequest OpenEdge.Web.InternalWebRouter at line 113 (OpenEdge\/Web\/InternalWebRouter.r)"}
  13. Roger Blanchard
    Roger Blanchard avatar
    381 posts
    Registered:
    29 Jun 2018
    03 Apr 2021 in reply to Roger Blanchard
    Link to this post
    Let me dig into this on Monday.

    Thanks again.
  14. Mike Fechner
    Mike Fechner avatar
    319 posts
    Registered:
    14 Sep 2016
    03 Apr 2021 in reply to Roger Blanchard
    Link to this post
    At first sight it looks like the SwaggerHelper instance has not been initialized. Not sure why that happens in your case. Might be better to log a support ticket.  
14 posts, 2 answered