From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

WebDAV session no error but not connected

Solved!
Go to solution

I am very eager to get up and running with webDAV. I see two main use-cases:

 

1) cRIO pushes log files to a remote WebDAV server

2) cRIO acts as a webDAV server to allow remote clients to access files

 

"Why" is in both cases because its a safer way to do file transfers, particularily with HTTPS enabled.

 

My first step was to setup a WebDAV server on Windows 7 (one of many how-to's) .. after some tinkering (I put the shared virtual folder into C:\ProgramData\ as e.g. my desktop is not read/write accessible by the windows WebDAV server by default), I was able to connect to the windows 'DAV server from a browser with (in my case) http://192.168.1.40/cRIO/ where the name of my virtual folder is cRIO.

 

My next step was to try and access this windows 'DAV folder from the cRIO (on the same network), and thats where I got stuck.

It seems like the "open session" will happily chug anything and not report an error, even when I sent inputs such as a user-name = domain\user name and empty password or even an incorrect IP...  This makes troubleshooting and learning a new interface rather much like playing hide-and-seek while blindfolded.

I left the last set of "inputs" that I tried as default values, except for the username and password (for obvious reasons).

 

Long story short, I can't figure out why this (below) code will not work?  any insight or suggestions would be appreicated!

simple webDAV cRIO test VI

 

Anyone?

 

QFang
-------------
CLD LabVIEW 7.1 to 2016
0 Kudos
Message 1 of 23
(10,850 Views)

By the way, the same VI as posted but changing the IP and username/psw will correctly connect to and retrieve file/folder info if I run it on Windows connecting to the webDEV server I have running on the cRIO...

 

Is it possible that the WebDAV VI's that ship with 2013 are specific to the cRIO WebDAV instance, i.e. that the authentication used by the "open session" vi is hard-coded to do NI-AUTH?? If so, that could explain why the cRIO cannot connect to the Windows 'DAV server, but Windows can connect to the cRIO 'DAV server..  However, it does not adequately explain why the open session vi does not give any warning or error if a connection is not made.

QFang
-------------
CLD LabVIEW 7.1 to 2016
0 Kudos
Message 2 of 23
(10,849 Views)

So I made one step forward in my attempt at accessing a Windows WebDAV server from the cRIO:

 

I found out (by remote-desktoping to another computer on our domain) that the server my laptop is running is not accessible from external machines. I disabled all firewalls and voila I could now access my laptop webDAV server from a 3rd computer.

 

Excited, I returned to the simple test vi on the cRIO, it still doesn't work, but at least now the behavior has changed somewhat.  open/close sessions still don't produce any errors, but now the two other calls do!

code 363504

Possible reason(s):

LabVIEW: Invalid username or password combination.

 

to show what I tried, lets pretend our company domain name is dname and that my user name is user..  I tried:  dname\user  and  dname/user   and user.

I know I am entering the correct password, but retyped it several times to make sure.

 

.. my journey continues, and maybe some day this can be a resource for other people trying to do the same thing I am. 

 

[edit:]  error code 56  --> check your firewall settings and/or temporarily disable your firewall!!

QFang
-------------
CLD LabVIEW 7.1 to 2016
0 Kudos
Message 3 of 23
(10,843 Views)

Firewall issue was simple enough to resolve. Had to manually add a rule to allow incoming TCP on port 80. I added 443 as well in anticipation that once I get this all up and running, I want to move to HTTPS for the webDAV interface..

QFang
-------------
CLD LabVIEW 7.1 to 2016
0 Kudos
Message 4 of 23
(10,839 Views)

Hi QFeng,

 

Have you tried using some of the examples for WebDAV from the NI Example Finder to connect to your WebDAV server?  There is an example in Help>>Find Examples>>Search>>WebDAV that is called WebDAV Sync.vi.  I would see if that can connect to your server.  That will help us determine if the server has settings that the WebDAV functions do not support.  Also, have you been able to connect to your server using any other third-party WebDAV clients?  Let us know!

| Zach J. | Systems Engineer, HIL and Test Cells | National Instruments |
0 Kudos
Message 5 of 23
(10,801 Views)

Hi Zach,

 

The synch example does not run on a cRIO, at least in part due to "Control Online Help". I will comment out the TDMS part of that part of the example.

...

I commented out the TDMS part in the synch. I add the synch VI to a LabVIEW project. If I run the VI from the "My computer" scope, I can access the webDAV server running on "my computer". If I move the VI to the cRIO and run the same control inputs from the cRIO I get the 363504 error. .

ni WebDAV.png

 

Again, just to point out, I can access the Windows WebDAV server that runs on my laptop from other PC's on our network, just not from the cRIO.  I suspect there are some extra steps or changes needed on the server side to allow cRIO (non-windows) to authenticate and log on to the Windows WebDAV server.

 

I also have used 3rd party WebDAV clients: BitKinex

Using BitKinex, I can connect to my Windows WebDAV server from both the server (laptop/localhost) and form other computers on the network.  If you have a different 3rd party client you want me to try, and/or there is some operation you would like me to perform using BitKinex, please let me know!

 

These are my Windows WebDAV authentication options.. I do not know which option is appropriate for LabVIEW/cRIO WebDAV access. . It would appear Windows Authentication is not supported.  NI Auth is not on the list (obviously) and I'm not sure what the background method of NI Auth is, but obviously it must support some standard authentication interface as I'm able to access the cRIO from a normal browser when going the other way.

authentication options.png

 

Thanks,

QFang

QFang
-------------
CLD LabVIEW 7.1 to 2016
0 Kudos
Message 6 of 23
(10,794 Views)

Hi QFang,

 

What program are you working with to set up the WebDAV service on your PC?  Have you tried using Basic Authentication yet?  I am looking further into this issue but I have not found any relevant information about accessing a WebDAV server from the Real-Time target just yet.  Most of our documentation is based on accessing the Real-Time target through WebDAV.  Is there a way you can export some kind of configuration file for the WebDAV server you have configured?  We can try to do some testing to see if we get any success as well.  Let me know!

| Zach J. | Systems Engineer, HIL and Test Cells | National Instruments |
0 Kudos
Message 7 of 23
(10,770 Views)

Hi BluesKnight, thanks again for looking at this!

 

I followed the instructions found here more or less to the t.  If I understand things correctly, "basic" is not supported by HTTP(?) but even if it were, it would probably defeat the purpose as aparantly during basic, the username and password is sent un-encrypted.. this is all based on a few statements in the linked article/how-to so take it with a grain of salt. ("You can’t use Basic authentication with HTTP. This is a good thing: in such a scenario, your password would be sent in plain text. Either use HTTPS or turn on Windows Authentication.")

 

As a quick update, I installed and configured another WebDAV server on one of our actual server computers (Windows 2008 R2).  After configuring that server, I tested the connection from my laptop with BitKinex. To simplify the testing between LV Windows and LV RT, I went back to using the “simple get” with constants wired to all the inputs and the poly set to "file".. This is as simple as it gets and is supported both on windows and RT.. When I run the wrapper (with the constants) from my project from the Windows scope, it runs and fetches the file without error. When I move the same wrapper to the RT target and run it, I get the authentication error.. I see no good reason why the behavior should be different between the two run-scopes.. The network traffic generated should be identical so I don't understand why the Win vs RT scope should make a difference??

 

By the way, using anonymous or basic authentication schemes is probably not relevant as the drive to move to WebDAV is increased network security..

 

Thanks again for looking at this!! I'm stuck and out of ideas to move forward.. I'm left with two thoughts: It's somehow a bug/feature in the NI side of things when running on 9014 cRIO's  OR  it is somehow related to our network?

QFang
-------------
CLD LabVIEW 7.1 to 2016
0 Kudos
Message 8 of 23
(10,761 Views)

Does anyone know of, or have, a WebDAV server hosted online that I can try to connect to? https or http? with demo username / password? -if anyone do, please feel free to PM me!

QFang
-------------
CLD LabVIEW 7.1 to 2016
0 Kudos
Message 9 of 23
(10,760 Views)

Hi QFeng,

 

I am going to set up a WebDAV server and do some testing on my end to see if I can make connections from a cRIO.  As far as the documentation is concerned, this should be possible.  I will let you know my results once I have them!  In the mean time, please let me know if you come up with any breakthroughs of your own!

| Zach J. | Systems Engineer, HIL and Test Cells | National Instruments |
0 Kudos
Message 10 of 23
(10,740 Views)