RESTResponseV2 : getCookies() method not working in Scoped application.

Anuja Jadhav1
Tera Contributor

Hi Team,
I am using instances with the Tokyo version.
Where I am writing code to call REST API which returns JSESSIONID in cookies. Below is an example:
var sm = new sn_ws.RESTMessageV2();
sm.setEndpoint(url);
sm.setHttpMethod(method);

var response = sm.execute();
var cookies= response.getCookies() // Getting exception at this point


- We are getting below exception while getting cookies.
JavaException: java.lang.RuntimeException: invalid return type: java.util.ArrayList




3 REPLIES 3

Prince Arora
Tera Sage
Tera Sage

@Anuja Jadhav1 ,

 

"getCookies()" doesn't work in the scoped Application, Please check the suppot URL here, 

 

For those who (if anyone) come across this issue, it's actually a problem and is currently being looked at by ServiceNow, Please check the relatable thread

 

If my answer solved your issue, please mark my answer as Correct & 👍Helpful based on the Impact!

Hi @Prince Arora ,

Even it is not working ithe Global scope. 

 

@Anuja Jadhav1, Did you get the solution to fix it? 

 

@Vikas Sakhare It worked for me in a global scope.