- 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-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-04-2024 11:23 PM
Many thanks Appli!
Yes, this sounds as a good solution, much better than struggling with code and outdated APIs! I will investigate the details, but thank you very much for all your help already!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2024 05:47 AM
Hello Marek,
I did not get if your goal was to pass the proxy's user and password to the Script include ran by the MID Server. We did something passing them in the XML of the ecc_queue and reading these parameter from the Script Include ran by the MID Server, this way:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2024 07:21 AM
Dealing with proxy authentication for HTTPS connections from the MID server can be tricky. It's great that you're considering using the attachment API for transferring big files.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2024 05:48 AM - edited 03-27-2024 05:48 AM
Dealing with proxy authentication for HTTPS connections from the MID server can be tricky. It's great that you're considering using the attachment API for transferring big files.To add proxy username and password to the MID server script include, you'll need to configure the proxy settings in your script. This typically involves setting the proxy server address, port, and credentials. Ensure that your script include includes the necessary proxy settings and credentials to authenticate with the server. This should help resolve the errors you're encountering.