
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2020 11:22 AM
Hi,
i have an api running on localhost:8080 port and it is working fine when i access on browser.
I created an REST API and trying to connect with that, but i am getting the following error.
Tried the sample code in background script.
var sm = new sn_ws.RESTMessageV2();
sm.setEndpoint("http://localhost:8080/");
sm.setHttpMethod("get");
sm.execute();
java.net.ConnectException: Connection refused (Connection refused) when posting to http://localhost:8080/
Any idea what might be the issue?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2020 01:25 PM
Localhost is local to your machine/network and not publicly available to cloud platforms like ServiceNow.
What you need to do is setup a MID server on that machine, and then set the MID Server in your REST call.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2020 01:25 PM
Localhost is local to your machine/network and not publicly available to cloud platforms like ServiceNow.
What you need to do is setup a MID server on that machine, and then set the MID Server in your REST call.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2023 12:27 AM
could you please elaborate where to setup MID server- on servicenow or my local machine. Also how to do it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-29-2024 12:59 PM
@asifnoor Were you able to solve this? Can you please share the resolution?
Thanks