Invalidate a REST - Forum - OpenEdge Development - Progress Community
 Forum

Invalidate a REST

This question is answered

Hi, 

I want to invalidate a rest session based on a condition.

After going through below link I understand that logout.html should be called and there is no other way to invalidate. 

https://knowledgebase.progress.com/articles/Article/How-to-invalidate-a-REST-session-from-a-Business-Entity

I was able to achieve this by making http call using IHttpRequest. But I do not want to hardcode the port as the instance can be  configured  with different ports.

Is there a way I can get configuration information from SESSION object ?

Any other approach is  also fine .... 

Thanks in advance.

Verified Answer
  • If you are using the WEB transport, then you can query the LocalHost, LocalAddress and/or LocalPort properties on a WebRequest object. You can simply create one
            define variable webRequest as IWebRequest no-undo.
           
            assign webRequest = new WebRequest().
     
     
    The port that the instance is started on is in the $CATALINA_BASE/conf/catalina.properties file, and is kept in the psc.as.http.port property.
    You could alternatively pass the port as a value to the session startup procedure (via the  sessionStartupProcParam).
     
    And you may want to log a bug (or Idea) asking for this information to be made available to the sessions.
     
     
All Replies
  • If you are using the WEB transport, then you can query the LocalHost, LocalAddress and/or LocalPort properties on a WebRequest object. You can simply create one
            define variable webRequest as IWebRequest no-undo.
           
            assign webRequest = new WebRequest().
     
     
    The port that the instance is started on is in the $CATALINA_BASE/conf/catalina.properties file, and is kept in the psc.as.http.port property.
    You could alternatively pass the port as a value to the session startup procedure (via the  sessionStartupProcParam).
     
    And you may want to log a bug (or Idea) asking for this information to be made available to the sessions.
     
     
  • Thank you Peter, sessionStartupProcParam works for me.

    Regards

    Rajiv