LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

HTTP Client VIs not functioning

Solved!
Go to solution

Hi,

 

I am trying to establish connection with web server using HTTP Client VIs but receives error dialog "LabVIEW:  Failed to connect to the specified hostname.  Be sure the specified hostname is correct, the server is running and configured to accept remote requests."

 

The hostname does exists and I can browse the web page in internet explorer or chrome.

 

I tried many websites (HTTP and HTTPS), but received same error.

 

If I use the webbrowser .NET or ActiveX component in front panel I can see the webpage opened on front panel. 

 

I tried using Header Information VIs such as "User-Agent", "Accept-Encoding", "Language", etc. before opening the host connection but there is no success. 

 

I discovered that the internet connection is via "McAfee" web proxy which should be blocking the request from HTTP Client and allowing from WebBrowser. 

 

Can anyone help me understand what settings would be needed to establish the connection..?

 

Thanks and regards,

 

Kunal

0 Kudos
Message 1 of 11
(5,739 Views)

Hello,

the error 363500 means that remote host was not able to perform any connections.

 

Did you try the highlighted execution to find out if the error handler vi clears any error you may have?

Alternatively, you could disable the automatic error handler by clicking from the Menu button:
File >> VI Properties >> Execution >> (uncheck the) Enable Automatic error handling.

Greetings and Regards,

James

Greetings and Regards,
James
0 Kudos
Message 2 of 11
(5,683 Views)

Hi James,

 

Yes, the remote host is not available. But it is not reachable via HTTP Client VIs. 

 

I tried your suggestion, but it handles the error, no popup was displayed; doesn't provide results. 

 

I get webpage (host) information if I use WebBrowser control. My objective is to use HTTP Client VIs. 

 

What I have discovered is, web proxy from McAfee is playing major roles in filtering the contents. 

 

What additional information/setting is needed to obtain host communication when application is running behind the firewall.

 

Thanks and regards,

 

 

Kunal

 

0 Kudos
Message 3 of 11
(5,665 Views)

Hi,

 

You cannot "work-around" anti-virus or firewall software. This is what the purpose of the firewall is, you could ask your IT department to allow the relevant ports.

 

It would be helpful if you could provide a wireshark capture during the request:

 

https://www.howtogeek.com/104278/how-to-use-wireshark-to-capture-filter-and-inspect-packets/

 

Then save this capture and upload it, you should receive errors of either timeout or the firewall explicitly refusing the connection. The VI would also be helpful so we can run this ourselves and verify if the problem may not lie then.

 

Best regards,

 

Ed

0 Kudos
Message 4 of 11
(5,646 Views)

Hi,

 

Installing wireshark is not permitted. IT declined the request for installation.

Neither firewall exception is possible.

 

I have silly question:

I can use webbrowser control and it's properties/methods to access webpage. Still not successful to process GET/POST requests.

WebBrowser control is interacting with remote host, then what is difference in implementation of WebBrowser and HTTP client VIs.

I wanted to know what extra is needed for HTTP Client VI implementation that will replicate  webbrowser functionality.

 

Thanks and regards,

 

Kuna

0 Kudos
Message 5 of 11
(5,631 Views)

Can you access the server logs to see whether it even receives the messages?

 

Can you share your VIs and what address you enter into the web browser for comparison?

0 Kudos
Message 6 of 11
(5,626 Views)

I don't know how to access the server logs, but I think through HTTP Client VIs I cannot.

 

Here are the two VIs; one using webbrowser and another using HTTP_Client.

 

The WebBrowser shows the webpage but HTML_Client does not return header contents; responds error message.

 

 

Download All
0 Kudos
Message 7 of 11
(5,618 Views)
Solution
Accepted by topic author kunalbhate

Have you checked if your Internet settings have a WebProxy configuration? This can be set by the IT departement without your knowledge to make sure everybody internally connects to that proxy and then every direct HTTP traffic is simply filtered. All Webbrowsers will usually check the Internet WebProxy settings, but the NI HTTP VIs don't rely on the Windows WebAPIs but use an open source implementation (curl and friends) internally that implement the whole HTTP protocol stack directly on top of the socket library.

As such they don't seem to use the Windows proxy settings automatically but you need to configure the proxy explicitly in your software. Basically you need to connect to the proxy instead of the direct web address, and you might have to add one or two extra header lines to the request.

Rolf Kalbermatter
My Blog
0 Kudos
Message 8 of 11
(5,610 Views)

Hi Rolf,

 

Thanks for your feedback. That solves my problem (rather doubt). 

 

Yes, there is a WebProxy which is set by IT department. Unfortunately the settings are not visible to anyone in the organization.

 

The issue can be resolved by adding required extra header lines but that's not a generic solution. Every location there could be different proxy settings. Few may be behind proxy, few can be without. Configuring the header for every location would be a tedious task for commissioning team. 

 

I would rather use web-browser component to process all requests.

 

Thanks again for your support.

 

Thanks and regards,

 

Kunal

 

 

 

0 Kudos
Message 9 of 11
(5,593 Views)

Hi!

 

I think I have the same struggle...

 

The explanation from RalfK is interesting. Is there an example of implementation of this webproxy configuration in Labview available?

 

Thanks in advance!

 

Andy

 

0 Kudos
Message 10 of 11
(4,227 Views)