简体   繁体   English

如何将Web服务器重定向到特定的URL?

[英]How can i redirect a web server to a specific url?

Hi guys. 嗨,大家好。 I create a public content under my web service. 我在Web服务下创建公共内容。 I am trying to replace index.html to public content. 我正在尝试将index.html替换为公共内容。 Then i will be able to send data to that web page in labview. 然后,我将能够在labview中将数据发送到该网页。 Any helpful idea? 有什么有用的想法吗?

here is the project part 这是项目的一部分

here is the vi part 这是vi部分

Well. 好。 The project should look like this. 该项目应如下所示。 在此处输入图片说明

So, please consider placing the index.html directly under Public Content folder. 因此,请考虑将index.html直接放在Public Content文件夹下。

Then right click on your VI and select the appropriate method. 然后右键单击您的VI并选择适当的方法。 Then right click and select "Show Method URL". 然后右键单击并选择“显示方法URL”。

If you want a VI that receives some value from index.html and then replies with other values you can specify inputs and outputs (you should connect them to connector pane). 如要VI从index.html接收一些值,然后用其他值进行答复,则可以指定输入和输出(应将它们连接至连接器窗格)。

  • To be able to use all features of HTTP you might want to right click on web service under project hierarchy select properties, go to HTTP Method VI Settings, select your VI, Go to Output Type and change to Stream. 为了能够使用HTTP的所有功能,您可能需要右键单击项目层次结构下的Web服务,选择属性,转到HTTP方法VI设置,选择VI,转到输出类型,然后更改为流。 在此处输入图片说明 If you change this to Stream, then you can use "Write Response.vi", output terminals will not work. 如果将其更改为Stream,则可以使用“ Write Response.vi”,输出端子将不起作用。

After all this you right click on web service and select start, then right click Application web server and select Publish. 完成所有这些操作后,右键单击Web服务并选择“启动”,然后右键单击“应用程序Web服务器”并选择“发布”。

Please use these links as references: http://zone.ni.com/reference/en-XX/help/371361K-01/lvhowto/build_web_service/ 请使用以下链接作为参考:http: //zone.ni.com/reference/en-XX/help/371361K-01/lvhowto/build_web_service/

http://www.ni.com/white-paper/7747/en/ http://www.ni.com/white-paper/7747/en/

http://www.bloomy.com/sites/bloomy.com/files/bloomy_whitepaper_upandrunningwithlabviewwebservices.pdf http://www.bloomy.com/sites/bloomy.com/files/bloomy_whitepaper_upandrunningwithlabviewwebservices.pdf

You can email me if you want me to send you examples, but there are lot of examples online. 如果您希望我向您发送示例,则可以给我发送电子邮件,但是在线上有很多示例。 My email is: khachiksah.91@gmail.com 我的电子邮件是:khachiksah.91@gmail.com

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM