12-13-2011 09:07 AM
Thank you for the example. I will try it. Is there any way to do SSL? Does the web browser handle that? Also, how do I read back the response form the web server? It will be sending back XML information that I will have to parse.
Thank you.
12-13-2011 09:46 AM
I also found examples showing how to use the .NET web requests to send a HTTP post and it states that you can use HTTPS as well. Proxy confguration appears to be also available. Link: http://forums.ni.com/t5/LabVIEW/NET-Http-Https-Get-document/m-p/405426?requireLogin=False
But for some reason when I select the webrequest under .NET constructor it states that a public constructor is not available. Is there any way to get this on my computer (make available) so that I can try this to see if it works?
12-13-2011 12:57 PM
@Dru1d wrote:
But for some reason when I select the webrequest under .NET constructor it states that a public constructor is not available.
That first node is a static method, not a constructor. The arrow in the header prior to the name WebRequest indicates a method (Invoke node). You need to place an Invoke node on the block diagram, click on the node and choose "Select class". Then find the namespace and class. Once you do you will be able to select all of the available static methods, of which Create is one.
12-13-2011 12:59 PM
Thank you very much. I was racking my brain on how to do this.
I will try this and see how it works. Will report back.
12-13-2011 04:54 PM
Hi, I was able to to a simple get request. How can one do post request via this method? Also, how can i do https post via ssl utilizing a ca certificate file from the server?
Thank you greatly.
12-13-2011 05:44 PM
You'll need to search around on the net for an example on using .NET to do an HTTPS POST and then you should be able to duplicate the code in LabVIEW. A quick Google turned up this example: http://www.terminally-incoherent.com/blog/2008/05/05/send-a-https-post-request-with-c. Attached is a VI that tries to implement this, but I have no way of testing it, so you'll need to play around with it.
12-14-2011 10:45 AM
Hi smercurio_fc,
I tried this by substituting the HTTP POST example from http://zone.ni.com/devzone/cda/epd/p/id/3153. It worked although the site responded stating that I didn't put in a location but it shows that the code works and can communicate through my proxy to the website. Fantastic.
My only question is how is this doing or how can it do HTTPS? Do I just change HTTP to HTTPS and the .NET code sends a HTTPS POST? How do I incorporate the CA Certificate file that I have from the server vendor?
Thank you very much.
12-14-2011 05:49 PM
Hi,
I am trying to add the CA certificate to teh POST request via this description.
http://msdn.microsoft.com/en-us/library/ff649203.aspx
Attached you will find a picture but it is telling me that the X509CertificateCollection is missing a wire or not wired correctly. What am I missing here and am I doing this correctly so that I can do HTTPS POST with a CA Certificate file.
12-19-2011 02:37 PM
Can anyone help with this in teh last post?
12-19-2011 04:01 PM
Well you have static objects and dynamic objects. Dynamic ones need to be optained by using a constructor.