Setting Null Value to .Net Variable Attribute

taher.bha
Member Posts: 48
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:
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) :
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
0
Answers
-
Please check whether Point 8 helps you or not?
http://vjeko.com/blog/top-10-things-i-miss-in-net-interoperability-in-nav-20130 -
Thank you Mohanna for your help.
Unfortunately, I already tried this solution with no result, as described above.0 -
We found finally a workaround by setting up Internet Explorer to use a proxy (which is "inherited" by the ftprequest).
That was strange as Filezilla was able to connect before setting the proxy, but this resolves the problem.
Thank you all.0 -
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions