Hi,
As a requirement for one of our customers, we needed to retrieve CSV files from an FTP Server so as to parse them.
I'am using
Igor Pchelnikov library which can be found here
http://www.mibuso.com/dlinfo.asp?FileID=1539 .
This works perfectly but we faced some problems while deploying at the curstomer's site ( a .Net error when getting response
FTPRequest.GetResponse).
I resolved the issue within a small .Net test application using almost the same code by applying a Null Value to the Proxy attribute of the request. Here's the c# code:
ftpRequest.Proxy = null;
I cannot figure out how to do it the Nav Way.
I tried with no success declaring a Sytem.Object .Net object called NullProxy and tryed to use it to force the Null Value
(as suggested by VJEKO
https://community.dynamics.com/nav/b/navigateintosuccess/archive/2013/06/19/top-10-things-i-miss-in-net-interoperability-in-nav-2013.aspx).
I also tried using other .Net types (which theorically meet the Proxy attribute Type) with no success
System.Net.IWebProxy.'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
and
System.Net.WebProxy.'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
Here's the library's code (the commented part is my own code) :
FTPRequest := FTPRequest.Create(FTPAddressFile);
Credentials := Credentials.NetworkCredential(Login,Password);
FTPRequest.Credentials := Credentials;
FTPRequest.KeepAlive := TRUE;
FTPRequest.Method := 'RETR';
FTPRequest.UsePassive := TRUE;
FTPRequest.UseBinary := TRUE;
//---
//Proxy to be Set to .Net Null Value here
//FTPRequest.Proxy := NullProxy;
//---
FTPResponse := FTPRequest.GetResponse;
ResponseStream := FTPResponse.GetResponseStream();
Any ideas ? Thx in advance
Answers
http://vjeko.com/blog/top-10-things-i-miss-in-net-interoperability-in-nav-2013
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Unfortunately, I already tried this solution with no result, as described above.
That was strange as Filezilla was able to connect before setting the proxy, but this resolves the problem.
Thank you all.
Did you really try his workaround?
"declare a DotNet variable of subtype System.Object, name it null, and never assign any value to it"