- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2024 06:14 AM
Hello Guys,
I need to transfer big files (100MB) from the MID server to the instance for loading and I am trying to find a solution. The preferred one would be using attachment API I guess. In my case the MID server is behind a proxy which requires authentication.
I investigated Remote File Importer (Import Files from a MID Server) - Share | ServiceNow Developers and found out it uses MID server's own connection parameters including proxy settings but does not use proxy authentication hence I am getting errors from proxy. Do you know how to add proxy username and password to the MID server script include?
I tried simply adding:
Packages.java.lang.System.setProperty("http.proxyUser", ms.getConfigParameter("mid.proxy.username"));
Packages.java.lang.System.setProperty("http.proxyPassword", ms.getConfigParameter("mid.proxy.password"));
Packages.java.lang.System.setProperty("https.proxyUser", ms.getConfigParameter("mid.proxy.username"));
Packages.java.lang.System.setProperty("https.proxyPassword", ms.getConfigParameter("mid.proxy.password"));
but it did not work.
Then I tried:
var proxyuserpass = new Packages.java.lang.String(ms.getConfigParameter("mid.proxy.username") + ":" + ms.getConfigParameter("mid.proxy.password"));
var proxyAuth = "Basic " + (new Packages.javax.xml.bind.DatatypeConverter.printBase64Binary(proxyuserpass.getBytes()) + '');
conn.setRequestProperty("Proxy-Authorization", proxyAuth);
but again - no luck...
Thanks in advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2024 07:02 AM
Hi, This remote file importer may not be up to date, probably deploying it to the instance of latest releases is too risky
Downloading from MID server - consider another method - set up SFTP server on MID server' host and retrieve the file over data source of SFTP type. Integration Hub (Pro or Ent) supports SFTP steps making it possible to use Flow Designer for SFTP operations.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2024 02:12 PM
Hi, please check if these MID server properties are set; as per DOC page: mid.proxy.username and mid.proxy.password
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2024 11:10 PM
Hi Appli, yes, these are set and the MID server itself connects successfully. Here I wanted to make a connection from MID Server Script Include using those parameters (so the proxy username and password does not need to be hardcoded or stored separately somewhere) but it seems the proxy parameters set as in my original post does not work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2024 05:13 AM
Hi, thank you for replying. May you please check if solution provided in this thread addresses your query.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2024 06:23 AM
Thanks for that! Although it does not fit directly into the approach I took based on Remote Importer (it uses Packages.java.net.URL(<url>).openConnection() instead of Packages.com.glide.communications.HTTPRequest(<url>)) I will explore the provided solution when I have some time (there was a change in the approach now).