LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically Enable/Disable Web Service at Run-Time

Solved!
Go to solution

Is it possible to enable and disable LabVIEW Web Services in my application at run-time?  If for example, I build an application with the web services, I have cases where I would like to prevent any access via the web service.

 

I was unable to find any Web Services VIs that appear to do what I'm asking.

0 Kudos
Message 1 of 4
(3,533 Views)
Solution
Accepted by topic author NathanDII

Hi NathanDll,

 

You should be able to do this.  Check out this KnowledgeBase article:

 

Can I Programatically Start and Stop the LabVIEW Web Server?

 

http://digital.ni.com/public.nsf/allkb/6816DE13DCE0601986256C02007DEAA5

 

Let me know if this is not what you are looking for!

 

Nick G.
Applications Engineering
National Instruments
Message 2 of 4
(3,477 Views)

The method that Nick mentions should work - but if you only want to disable certain web services or certain VIs/URIs - you could have the web service VIs return invalid/blank data depending on a condition in your application (e.g. a ISServerActive? shared/global variable). For example, you get have the VI return a different HTTP status code (using the Web Service VI) if you don't want to accept the request (e.g. 404 not found, 401 unauthorised, 403 forbidden etc.).


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 3 of 4
(3,442 Views)

Thanks guys!  I can't believe that I didn't find that article through my searches.  I guess it might be because I was searching for "services" instead of "server".

0 Kudos
Message 4 of 4
(3,428 Views)