SystemLink Forum

cancel
Showing results for 
Search instead for 
Did you mean: 

Systemlink with Webservice

Hi, I have a problem to access the web-service on system link cloud.

 

reference :[ I follow the example of CallLabVIEWWebService(https://github.com/ni/webvi-examples)]

1.  I can successfully publish the package, it test ok on local PC.

Call LabVIEW web service.PNG

2. I upload it to system cloud, and test it on the local PC, it is ok.

system link.PNG

3. I use another PC to access system link clould, it says cannot find the service. How can I publish it and make it access from other PC?

system link error.PNG

 

 

Thanks.

 

 

0 Kudos
Message 1 of 3
(3,235 Views)

Am I right in assuming that you are attempting to login to the same account on the two separate machines? Also, are you able to navigate to the webservice and see your app listed there? When you say you tested it on the local machine after you uploaded it, did you click on the web app and interact with it on SystemLink Cloud or did you use the local web service again? 

 

Lastly, did you make sure to configure CORS as is outlined in the guide?

 

 

-----------------------------------------------
Brandon Grey
Certified LabVIEW Architect

0 Kudos
Message 2 of 3
(3,186 Views)

Hi Mebelove,

 

I think I can help explain the behavior you are seeing. In example (1) the WebVI is running in the browser on the same machine as the LabVIEW Web Service. The WebVI can make HTTP GET requests to localhost and they work.

1.lvwebservice.PNG

 

In example (2), even though the WebVI files are hosted on systemlinkcloud.com, the WebVI itself is actually running in the Web Browser of the same machine as the LabVIEW Web Service. So when it makes a HTTP GET to localhost the requests still work.

2.lvwebserviceslc.PNG

 

In example (3), the WebVI is running in the Web Browser on a different computer. When the WebVI tries to do a HTTP GET to localhost on the different computer then the LabVIEW Web Service cannot be found because the Web Service is not running on the different computer. The localhost address always tries to connect to a server on the same computer making the request.

3.slcbroken.PNG

 

In order to use the LabVIEW Web Service from a different computer, you need to modify the WebVI so that it is making requests to the correct computer on the network. If you only want access in the Local Area Network, then you need an IP address, etc, as available on the Local Area Network. If you want it to work over the public internet, then you would be exposing the LabVIEW Web Service on the public internet (which is not a good idea unless you have a very strong understanding of how to secure servers exposed on the public internet).4.slcfixed1.PNG

Note in the above screenshot that the WebVI HTTP GET function was changed to no longer making requests to a URL pointing to localhost, but instead to a URL for the correct computer on the network.

 

Another option is instead of exposing the LabVIEW Web Service to the Local Area Network or to the public internet, you could instead use the Tags and Messages APIs to write to the NI Web Server or to systemlinkcloud. With the tags and messages APIs you can rely on the security NI has implemented for the Tags and Messages services. Then you can safely write to Tags and Messages from your LabVIEW application and read the Tags and Messages from your WebVI. An example that describes using Tags and Messages is available here: https://github.com/ni/webvi-examples/tree/master/CallSystemLinkDataServices

 

 

 

 

 


Milan
Message 3 of 3
(3,173 Views)