Setting Null Value to .Net Variable Attribute

taher.bhataher.bha Member Posts: 48
edited 2014-07-02 in NAV Three Tier
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

Sign In or Register to comment.