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 comment

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 comment

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 comment

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 comment

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.

×
×
  • Create New...

Important Information

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