LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Authentication errors from HTTP post VI

Solved!
Go to solution

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.

0 Kudos
Message 1 of 8
(6,418 Views)

Sorry, attachments here.

0 Kudos
Message 2 of 8
(6,415 Views)

 

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.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 3 of 8
(6,379 Views)

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.

 

0 Kudos
Message 4 of 8
(6,362 Views)

Wild guess here, but try this modification:

 

Screen Shot 2015-12-08 at 4.30.06 PM.png

 

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

Message 5 of 8
(6,338 Views)

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....

 

0 Kudos
Message 6 of 8
(6,334 Views)
Solution
Accepted by topic author FermWorks

Solved my problem with a combination of various required headers and syntax fixes.

0 Kudos
Message 7 of 8
(6,261 Views)

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

0 Kudos
Message 8 of 8
(4,201 Views)