LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Consuming Web Services Behind a Firewall

I am interested in consuming a web service behind a firewall.  As a test I have chosen LabVIEW supplied NETWeatherStation .net constructor example (though I have used the wsdl.exe tool to create my own .net references as well).  I believe I need to specify the proxy and credentials when I create a LabVIEW client.  How do I convert the information from a string control to the datatype that is expected as an input to the “Proxy” and “Credentials” Property Node?

 

I have attached the expected error when I attempt to access the web service without the proxy information as well as the beginnings of the solution I am looking for.

 

Thanks in advance.


 

Download All
0 Kudos
Message 1 of 6
(4,998 Views)
An additional attempt:
0 Kudos
Message 2 of 6
(4,980 Views)
You actually aren't having a problem with a firewall, but with an HTTP proxy server. This is like a firewall, but is designed to control access going out to the internet rather than coming in from the internet. To work around this, you'll need to configure the web service proxy with the URL and port of your proxy server, as well as the username and password required to get through it. That last part can be tricky depending on how your IT department has configured the proxy. Some use simple HTTP Basic authentication, some use your NTLM (Windows login) credentials, etc.
 
The problem is that you often don't even know it's there, because Internet Explorer is often configured by IT to auto-detect the proxy and do the right thing. When you write HTTP code yourself, you need to do it. A good starting point is below - it shows an example of doing just want you're trying to do, but in VB.NET.
 
 
But basically, you need to create an instance of System.Net.WebProxy with the URL and port. You also need to pass in an instance of the credentials (probably using System.Net.NetworkCredential) that contain your username/password.
 
If you can tell me what the proxy server demands (talk to your IT department), I can probably give you more specific help.
Message 3 of 6
(4,966 Views)
Thank you Brian, I think you hit my problem right on the head.  From using the wsdl.exe tool, I believe our proxy server demands: username, password, and domain.  If this is the case, I believe my final obstacle is to code the client to use proxy server when making the call to the web service.  Attached is a pic of my first (unsuccessful) attempt to do so.
0 Kudos
Message 4 of 6
(4,960 Views)
Ah, I think I see your problem. The credentials for the web proxy need to be wired into its credential list. The one you wired it into was the web service, which is where the un/pw would go if the WeatherStation required a login.
Message 5 of 6
(4,946 Views)
Fantastic!  Works like a charm.  Thanks very much.
0 Kudos
Message 6 of 6
(4,936 Views)