SFTP with Renci.SshNet in NAV and constructor - NAV 2018 Cu8

vremeni4
Member Posts: 323
Hi,
I need to implement SFTP in NAV so I decided to use Renci.SshNet .Net dll.
So far so good I can access the Renci.SshNet in NAV, but I cannot call any of the constructors. :-(
For example I need to create a variable ConnectionInfo.'Renci.SshNet with a hostname username and pass.
If I call the function like this
ConnInfo := ConnInfo(HostName ,'demo',passauthen);
or this
ConnInfo(HostName ,'demo',passauthen);
I am getting following error message.
ConnInfo is not a function, and only functions can be called with '(....'.
I can do this though
ConnInfo := ConnInfo;
but then I have no way of assigning the parameters e.g. hostname username and pass.
There are functions/properties for example ConnInfo.Host;
but they only return the parameter and they do not allow me to set it
[string Host :=] ConnInfo.Host()
What I do not understand if I go to "CAL Symbol Menu" and select the variable ConnInfo with option "Past Arguments"
I get this
[ConnectionInfo ConnectionInfo :=] ConnInfo.ConnectionInfo(string host, string username, AuthenticationMethod[] authenticationMethods)
But if I try to do this in the CAL editor I get the above error message.
Also the tool tip shows that the variable ConnInfo
has no parameters?!?!?
See screen shot

I tried to set the variable "RunOnClient" but this made no difference.
Is this a restriction in NAV or am I missing something.
Thanks for your help.
I need to implement SFTP in NAV so I decided to use Renci.SshNet .Net dll.
So far so good I can access the Renci.SshNet in NAV, but I cannot call any of the constructors. :-(
For example I need to create a variable ConnectionInfo.'Renci.SshNet with a hostname username and pass.
If I call the function like this
ConnInfo := ConnInfo(HostName ,'demo',passauthen);
or this
ConnInfo(HostName ,'demo',passauthen);
I am getting following error message.
ConnInfo is not a function, and only functions can be called with '(....'.
I can do this though
ConnInfo := ConnInfo;
but then I have no way of assigning the parameters e.g. hostname username and pass.
There are functions/properties for example ConnInfo.Host;
but they only return the parameter and they do not allow me to set it
[string Host :=] ConnInfo.Host()
What I do not understand if I go to "CAL Symbol Menu" and select the variable ConnInfo with option "Past Arguments"
I get this
[ConnectionInfo ConnectionInfo :=] ConnInfo.ConnectionInfo(string host, string username, AuthenticationMethod[] authenticationMethods)
But if I try to do this in the CAL editor I get the above error message.
Also the tool tip shows that the variable ConnInfo
has no parameters?!?!?
See screen shot

I tried to set the variable "RunOnClient" but this made no difference.
Is this a restriction in NAV or am I missing something.
Thanks for your help.
0
Answers
-
0
-
Thanks.
With winscp, I cannot load the file into memorystream, I have to save it on the disk first.
So I cannot use it, as the file has to be download and processes in memory, without storing it on the disk.
Thanks.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