01-22-2014 01:17 PM
Hello Guys
I have a slight problem with this great Web applications Server in Labview. It's a rather specific problem, so please bear with me when I'm explaining.
I have watch and done all the tutorials of how to setup shared variable and web service within a project. And I think I now get the point of how to set it up,
though the problem is when I'm accessing the webservice with a client via HTTP URL Method in my internet Browser (chrome)
through my defined port 8080, I can't operate my VI.
But when I'm using the local debugging Port 8001, everything is working perfectly.
My project that I'm testing on is, one of NI Labviews own demo project, so the project setup should have been done correctly.
I'm following this tutorial (http://zone.ni.com/reference/en-XX/help/371361K-01/lvhowto/build_web_service/#Deploying_WS) and it's at the end, at the point of
accessing the webservice with a client I get stock.
Can anyone explain or have an idea of why I can control my VI through port 8001 via URL HTTP Method, but not with port 8080?
I've attached the project I'm using, and a screen dump of my Web Server Configuration.
Further on I can't get the Data Dashboard App. (ipad) to operate my VI either, but I reckon that is because of the "port block" that I'm experiencing.
So I hope that will solve it self when I get the other thing to work.
Bonus info:
Windows 7
LabView 2013
Windows Firewall is off
Thank You
Nikolai
01-22-2014 01:28 PM
What happens when you access the URL using port 8080?
Here are a few things to check:
01-22-2014 01:39 PM
01-22-2014 01:50 PM
Hi Svalebaek,
When you go to publish your web service to the application web server are you hitting Start or Publish as in the screenshot below?
KiraT
01-22-2014 01:52 PM
Sorry, I didn't see your screenshot. I downloaded your project, published it, and tested it. It worked for me. Here is exactly what I did:
The browser showed me this XML:
<Response><Terminal><Name>Waveform Graph</Name><Value><DimSize>0</DimSize><DimSize>0</DimSize></Value></Terminal></Response>
That's the same result I get if I used the local debugging server.
This is where it's important to know exactly what happens when you try step 5. Does the server not respond? Or do you get a 404? Or some other error? The troubleshooting steps depend on what specific behavior you're encoutering.
01-22-2014 03:23 PM - edited 01-22-2014 03:27 PM
I get the same result as you AdamKenp, when I follow your actions step by step.
But I'm experiencing my problem when I'm doing the following:
The Firefox browser shows me this:
<Response><Terminal><Name>Waveform Graph</Name><Value><DimSize>0</DimSize><DimSize>0</DimSize></Value></Terminal></Response>
But when I do the excact samething, only thing changes is the Port i the URL, to 8001, firefox give me this:
<Response><Terminal><Name>Waveform Graph</Name><Value><DimSize>2</DimSize><DimSize>100</DimSize><Name>element</Name><Value>1.365820534045614</Value><Name>element</Name><Value>0.2481263239365297</Value><Name>element</Name><Value>0.3171664875733215</Value><Name>element</Name><Value>0.3195891750275047</Value><Name>element</Name><Value>0.5267863995084453</Value><Name>element</Name><Value>0.2952941658787431</Value><Name>element</Name><Value>0.9358545337460433</Value><Name>element</Name><Value>-0.06701462983182205</Value><Name>element</Name><Value>0.3546753386673981</Value><Name>element</Name><Value>-0.2006001034540738</Value><Name>element</Name><Value>0.09520115020050601</Value><Name>element</Name><Value>0.7084906734780858</Value><Name>element</Name><Value>0.6003776517685027</Value><Name>element</Name><Value>0.4717864538788902</Value><Name>element</Name><Value>-0.01959354175606056</Value>
As you can see, when i'm using the Local debugging port, I can read the result from the chart from the main.vi directly in the XML code. Further on I can Stop the main.vi from the stop.vi (GET) URL from my browser when using the 8001 Port, but that I can't do either when using the 8080 Port.
I believe you will have to "Start" the broadcast of the project and "Run" the main.vi before you can test if you get the same result as me.
01-22-2014 03:42 PM
Hi Svalebaek,
Your Web service is actualy working as expected. When you Publish a Web service to the Application Web Server, your Web service is going to act as it did in LabVIEW 2012. When you publish to the application Web server you are moving your Web service to a sepearte application instance than your LabVIEW application. There for interprocess comminication, like Global Variables, will not work.
There are 2 ways that you can solve this problem:
1. If you would like a UI and want to have a stand alone Web service, you can build your entire project into an executable and include the Web service. Your entire exe will operate in one context and therefore will work the way that it does on the debug server
2. If you would like to publish the Web service to the application web server you will need to replace the global variables with some sort of interprocess communication. For example, you can use Network Published Shared Variables to achieve your desired behavior.
Let me know if you have any questions about this.
KiraT
01-22-2014 03:47 PM
Personally I find the .exe route to be the easiest. You already have a build spec configured properly. Just build and run that, and then use the port number you configured there (8002). Then you get the data you expect. In that case you're getting data from the UI in your .exe.
Trying to make a web service published to the application web server communicate with a VI running in a regular LabVIEW instance is tedious and makes your application confusing and hard to debug. One of the big advantages of LabVIEW 2013 Web Services is that you don't have to do that anymore (you can just use an .exe).
01-22-2014 03:49 PM - edited 01-22-2014 03:50 PM
01-22-2014 03:52 PM
This help topic explains how to go about including a Web service into an exe using Application Builder.