How to resolve the issue:- java.lang.IllegalArgumentException: Invalid uri 'https://****.****.****.*****.***:9060/***/**/****/***/ReferenceError: "name" is not defined. (<refname>': escaped absolute path not valid

swapnilagrawal
Kilo Contributor

Hello All,

I have configured REST GET Method, its working fine when I'm Testing from REST Message GET method, but the same method when I called from workflow activity it giving me this error.

java.lang.IllegalArgumentException: Invalid uri 'https://***.****.****.*****.***:9060/**/***/**/**/ReferenceError: "name" is not defined. (<refname>': escaped absolute path not valid

find_real_file.png

Please guide to resolve the issue.

Thanks & Regards,

Swapnil Agrawal

10 REPLIES 10

I was not referring to the username, but to the path to the file on the server. Does that path includes spaces?



Regards


No URL has non spaces.


That's the only case I've seen so far. Maybe open an incident with ServiceNow support as that way you get a faster response.


Thanks Sergiu,



Could you please help me with the line of code which is used to Display the response of GET message with the help of gs.addInfoMessage function.


Hi Swapnil,



Following is the script using which you can print the response of GET method in REST.



var restCall = new RESTMessage('RestMessage1', 'get'); //RestMessage1 is name of the REST Message


  restCall.setStringParameter('xyz','xyz'); // xyz is the parameter


  restCall.setStringParameter('abc','abc'); // abc is the parameter


  var response = restCall.execute();


  responseBody=response.getBody();


  gs.print(responseBody);


gs.addInfoMessage(responseBody);




Mark Correct if this solves your issue or hit Like and Helpful if you find my response worthy based on the impact.


Thanks


Ankur


Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader