Invalidate a REST

Posted by rajivramarao on 24-Jan-2020 11:17

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.

Posted by Peter Judge on 24-Jan-2020 13:30

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

Posted by Peter Judge on 24-Jan-2020 13:30

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.
 
 

Posted by rajivramarao on 27-Jan-2020 06:31

Thank you Peter, sessionStartupProcParam works for me.

Regards

Rajiv

This thread is closed