LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Web Service with different results

This is my first try of LabView Web Service. I got different results between debug and published web services. 

 

The web service holds simple function: query the database and return the results (an array output).

 

When I was debugging the web service, by simply starting it, I got the correct results as shown in the following screen shot. The returned array had a size of 43 elements.

 

webs_1.jpg

 

After the debug, I published the webservice 'SQL access'. I checked the web service manager and showed that it indeed was running. 

 

webs_2.jpg

But when I tried to send a request to the web service method, it did not return any results, the array size was 0. 

webs_3.jpg

 

What did I miss here? Thanks for any help. 

0 Kudos
Message 1 of 4
(3,380 Views)

You might want to debug the connection to / query responses from the SQL server. Try logging to a file or a network variable, etc, from inside the Query Material VI.

 

One thing to keep in mind is that the published web service runs as a different user account (can also tell from the ApplicationWebServer.exe and NIWebServiceContainer.exe processes in Task Manager):

webservicesuser.PNG

 

 


Milan
0 Kudos
Message 2 of 4
(3,347 Views)

If the published web service uses a different user account, that can explain why the returned array is empty, because only authorized user can access the SQL server. 

 

What user account does it choose to use? Can you decide what user account to choose?

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

You can find the NIApplicationWebService configuration in the Windows Services Control Panel but I do not know if it is safe to change the User Account that the service runs as (my bet is that things will break but I have never tried it). From the Services control panel on my machine it looks like NIApplicationWebService is configured to run as the Local System account.

 

What should be safe is to include a web service in a stand-alone application and then run the application with the desired user account.


Milan
0 Kudos
Message 4 of 4
(3,290 Views)