08-20-2018 05:21 AM
Hello,
With Labview 2018 Web Service and LV NXG Web Module, I'm trying to do a authentification -> visualization model, but I can't redirect the client browser from the authentification page to the visualization one.
The authentification model is not done, I'm trying only to redirect from one html page to another. The "authentification" page is not even a real authentification page, but a simulated one. There is a button that calls with a get to the web service that is suposed to check the user credentials:
The Web Service Redirect_test response with the with the headers Access-Controll-Allow-Origin:* and Location: http://location:80/CT/visu.html and the 303 response code:
But when I click the Log in button, the visualization page isn't displayed in the screen, but only downloaded:
We can see the response of the server, and the visualization page in the edge register, and if I double click on Visu.html I can see the page but is not automatically loaded that is what i want:
How can I automatically redirect to the desired page? I have tried with 307 response code, with chrome, and with set HTTP Redirect VI with the same or similar results.
Thanks for your time, best regards,
Héctor Ingerto.
08-21-2018 04:15 AM
We have discovered that if we write directly the URL of the Redirect Web Service (127.0.01:8001/WS/Redirect_test) we are correctly redirected to the destination URL (localhost:80/CT/visu.html)
But we can't do the same when is the origin web page (localhost:80/CT/auth.html) who makes the get request to the Redirect Web Service (127.0.01:8001/WS/Redirect_test).
We are stuck here. Any one could helps us?
Thanks and regards.
04-10-2019 01:40 PM
Hello,
Any updates regarding this issue?
I'm facing the same problem and can't find any resources to help me.
09-24-2019 04:22 AM
Seems that a browser will only update the page when the user does the action of refresh or clicking a link. Or when javascript is used to simulate this kind of action. This last part was the part that was missing in the web editor of Labview nxg. So the page was downloaded but the browser didn't get any information of what to do with it, so the window kept unrefreshed.
For this reasong we had to cease using the web module, and do it in plain html, css and javascript. This was a long time ago, I don't know if now JS is implemented in the web module.
Best regards,
EMCCi
09-25-2019 10:35 AM
Hi EMCCi and Granado_93,
The JavaScript Library Interface is available in LabVIEW NXG 3.1 for Web VI. Here are a few examples.
Granado, what issues are you running into?
Preparing Your Code For Use With a JavaScript Library Interface
http://www.ni.com/documentation/en/labview-web-module/latest/manual/prepare-your-js-code/
Example of JSLI node that clicks a button
https://github.com/doczhivago/DownloadUploadAFileWebVI
Thanks,
Frank