Jump to content

Recommended Posts

I am trying to use the HTTP Client VIs to implement a version of the C# code found HERE. Unfortunately there are no NI examples of how the client VIs are to be used and my various attempts to string them together only seem to result in "Error 42" (LabVIEW: Generic Error) from the POST vi, rather than returning the headers and body text.

I have also tried using DOTNET calls and was at least able to get the login page returned but could not seem to trigger the login.

I switched to the HTTP Client VIs because they offered an alternate hope and I could at least see where to attach a cookie file with them (though a cookie file may not be the same as reserving space for a session cookie).

Any guidance would be appreciated!

post-2800-0-79797900-1342386159_thumb.jp

post-2800-0-48660600-1342386173_thumb.jp

Link to post
Share on other sites

You might consider checking out libcurl. They have a C binding, so you should just be able to drop CLNs and go nuts with it. I have had excellent luck in the past using libcurl (via php) to automate HTTP/HTTPS transactions.

Link to post
Share on other sites

I am trying to use the HTTP Client VIs to implement a version of the C# code found HERE. Unfortunately there are no NI examples of how the client VIs are to be used and my various attempts to string them together only seem to result in "Error 42" (LabVIEW: Generic Error) from the POST vi, rather than returning the headers and body text.

I have also tried using DOTNET calls and was at least able to get the login page returned but could not seem to trigger the login.

I switched to the HTTP Client VIs because they offered an alternate hope and I could at least see where to attach a cookie file with them (though a cookie file may not be the same as reserving space for a session cookie).

Any guidance would be appreciated!

You are connecting to an SSL address (https) but not configuring the internet session to use SSL.

Put a "ConfigSSL.vi" after the open.

  • Like 1
Link to post
Share on other sites

You might consider checking out libcurl. They have a C binding, so you should just be able to drop CLNs and go nuts with it. I have had excellent luck in the past using libcurl (via php) to automate HTTP/HTTPS transactions.

Thanks for the suggestion and link. If I cannot get LabVIEW bent to my will then I'll consider it.

You are connecting to an SSL address (https) but not configuring the internet session to use SSL.

Put a "ConfigSSL.vi" after the open.

Thank you! That did seem to help! I had tried using it (ConfigSSL.vi) at one time with this test code but had no luck and got scared away from it by all the inputs to the VI that I did not know how to use. After your suggestion I tried it again. My first try again yielded the error #42 but then I saw that the VI had a default-True boolean input telling it to check/use all those other inputs. I set the "verify server" input to false and the error went away and, based on the redirection and cookie I'm seeing, it appears like the login worked!

Thank you!

Link to post
Share on other sites

Thanks for the suggestion and link. If I cannot get LabVIEW bent to my will then I'll consider it.

Thank you! That did seem to help! I had tried using it (ConfigSSL.vi) at one time with this test code but had no luck and got scared away from it by all the inputs to the VI that I did not know how to use. After your suggestion I tried it again. My first try again yielded the error #42 but then I saw that the VI had a default-True boolean input telling it to check/use all those other inputs. I set the "verify server" input to false and the error went away and, based on the redirection and cookie I'm seeing, it appears like the login worked!

Thank you!

Yeah. If you are behind a natted router it will fail (as it cannot do a reverse DNS lookup to verify the server). But you've figured it out.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Similar Content

    • By P.Carpentier
      Hi Everyone,
      Most of the time I am able to find solutions to my issues just by reading this forum but I wasn't that lucky this time.
      So, i got an issue when i'm trying to install my build.
      I got the following message: "This distribution is built with an older version of winMIF that is not compatible with .NET 4.6.2 upgrade to 17.0"
      When googling this error message or even "winMIF" i can't find anything that match my request
      I tried to uninstall the .NET framework and then reinstall the 4.0 (and 3.5) and I got the same issue. (Exactly the same error even if it's .NET 4.0 or 3.5 ...)

      The computer used to build is a Win7Pro with Labview 16.
      The target computer is a WES7 (but I got the same issue on my dev computer ...)

      In advance thank you, 

      Piet
    • By kingcobraninja
      Ok anyone who can manage to contain their laughter for a minute, help me out with this.
      I need exactly what's in the title. Due to the deprecation of TLS1.0 and SSL3, we're disabling both on our web server that receives status information from hundreds of systems across the country via HTTPS. Some of the systems run Windows 7, some Windows XP. All of them run applications built in LV 2012sp1.
      In the past we've used the NI HTTP client VIs, which work well, and still work for some (?) Win7 systems. They don't work for the Windows XP systems. Are these VI's just a wrapper for the OS's HTTP client (IE)?
      We've also been down the .net WebRequest path, but from what I can tell the webclient class doesn't support any security protocols past TLS1.0, at least not in .net 2.0, and the HTTPClient class wasn't introduced until .net 4.5, which LV doesn't support, at least not in 2012 sp1.
      Lastly, we're considering the Encryption Compendium being offered in the JKI package manager, but it's 629 pounds, and if there's a way to do this without it, it would be preferred.  Also we're not sure it would work with the given constraints.  Has anyone used it/know anything about it?
      Any help is appreciated.
    • By mhy
      How do you decode, unpack a flattened string in python which was sent by a LabVIEW TCP server?
      I want to exchange data via loopback. Therefore I take a sine wave and flatten it to string and sent over the network Simple TCP - ServerSINE.viSimple TCP - ServerSINE.vi. Then I have to decode the incoming data in a way that I have the correct numerical values like when I plot them in LabVIEW. I did this so far in python_client.py but the values are wrong.
      Does anyone know how to work with the transferred Data in python?
    • By Artavazd
      Hello,
      Could you please share your thoughts about problem shown below?
       
      Thanks in advance.
       
      Software used:
      LabVIEW 2013 f2, 32 bit
      DSC 2013
       
      Problem:
       
      When trying to read a value of tag from third party OPC server which is not widespread software using NI DSC OPC client we got empty data.
      The type of tag in OPC server is Array of U16 and OPC server continuously writes array of values into that tag. However, NI DSC OPC client (and Distributed Systems Manager as well) defines type of that tag as String, thus can not read value of that tag (I suppose that NI OPC client is trying to treat variant data which holds array of U16 as string and because of conversation error issues empty data).
      At the same time Kepware’s OPC client defines type of that tag as a String as well, but can read the values of that tag which holds Array of U16 (I suppose that Kepware’s OPC client after getting error, while converting Array of U16 into String, starts to look in datatype defined into variant itself).
       
      Questions:
      Can the descriptions above explain the problem and if yes then what can we do to read the value of tag with DSC? Is there any opportunity to get more deep access to NI DSC OPC client to make some changes in order to work with customer OPC Server?
    • By chils
      I am using MySQL .NET Connector with my LV2013 application which has been working fine for months. Today the new exe started requiring the user to pick the location of the MySQL dlls. Ironically, the dialog opens to the directory with the dlls in it. Currently, the dlls are in the /data directory. I have tried moving them into the same directory as the exe. I did see this post, but it didn't help. I haven't tried putting the dlls into the GAC because it wasn't entirely clear where in the GAC they would go, and in principal, having the dlls in the same directory path as the exe should be enough.
       
      It would appear this is something related to the OS because the exe works on the dev machine - just not the target.
       
      Any suggestions would be greatly appreciated.
      Chris
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.