LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

HTTP Redirection

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:

 

Auth.webviAuth.webviAuth.webviAuth.webvi

 

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:

Redirect_test.viRedirect_test.vi

But when I click the Log in button, the visualization page isn't displayed in the screen, but only downloaded:

Click into Log In button in EdgeClick into Log In button in Edge

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:

visu.htmlvisu.html

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.

Set HTTP Redirect viSet HTTP Redirect vi

Thanks for your time, best regards,

 

Héctor Ingerto.

 

 

 

 

0 Kudos
Message 1 of 5
(3,506 Views)

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.

0 Kudos
Message 2 of 5
(3,444 Views)

Hello,

Any updates regarding this issue?

I'm facing the same problem and can't find any resources to help me.

0 Kudos
Message 3 of 5
(3,185 Views)

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

0 Kudos
Message 4 of 5
(3,004 Views)

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

https://github.com/doczhivago/DownloadUploadAFileWebVI/blob/master/Upload%20A%20File/Download%20Uplo...

 

Thanks,

Frank

0 Kudos
Message 5 of 5
(2,974 Views)