12-07-2015 05:43 PM - edited 12-07-2015 05:49 PM
I'm trying to query a third-party non-LabVIEW web service from LabVIEW 2014, using HTTP POST. Using another utility (restclient-ui-3.5-jar-with-dependencies.jar), I verified that the URL, username, password, and query syntax are correct and work on the same computer where my VI fails. I must be missing something when translating that to LV, because I get error 401 (Full authentication is required) and also 415 (Unsupported media type).
I have attached the config file used for the other utility, my VI, and a snapshot of the webservice's reply to the VI's post. I had to make everything anonymous, hiding the url, user, etc, so it can't really be tested as is, unfortunately. I tried with & without an extra authentication header, with & without Config SSL, etc. You can see the various options on the VI.
Any suggestions?
Thanks a lot.
Solved! Go to Solution.
12-07-2015 05:48 PM
Sorry, attachments here.
12-08-2015 03:57 AM
Posting code on the forums with a password is completely pointless - we need to be able to see the code to be able to help. If you can't post the code, post a simplified example. Because you've blanked out the URL, I can't even run it to check if it's a problem with your configuration.
Since we can't help you, you'll need to get in touch with the third-party web service provider and find the documentation for the web service about what headers/protocols you must use in your request. You can then compare what you're sending to what is sent by the tester you've used to see where the difference lies (e.g. using Wireshark).
I have heard of problems with the HTTP Client VIs and SSL - I found this thread.
12-08-2015 11:30 AM
Sorry, I forgot to remove the password again when I made a revision to the original. VI attached again, no password.
Yes, I realize it would be a lot easier to help if I could share the connection information, but I can't share it on a public forum, may be permitted to share with an individual. I have been in touch with the third party, and they are as helpful as they can be, but they don't know anything about LabVIEW.
Thanks for the link.
12-08-2015 04:33 PM
Wild guess here, but try this modification:
I wonder if the header is just not formatted properly in a way that the server acknowleges. By removing that extra syntax, this would enable the wire-level header to look like `Authorization: Basic <encoded-value>` rather than your previous syntax, which would produce `Authorization: Authorization: Basic <encoded-value>` on the wire
12-08-2015 04:42 PM
OH! is that how it works, the "header" is the part before the colon, not just some id.....
I'm happy it's probably just this simple dumb mistake, thanks a lot.
I can't try it until tomorrow when I'm at the customer site. Will let you know....
12-14-2015 09:09 PM
Solved my problem with a combination of various required headers and syntax fixes.
11-08-2019 09:32 AM - edited 11-08-2019 09:32 AM
Could you describe the final fix? I'm having a similar problem where using a java solution works (but is very slow), but if I try to use the HTTP VIs I get a "HTTP/1.1 401 Authorization Required" error. I tried using your VI, but I don't know how to supply the encoded portion of the authorization.
Thanks,
Bruce