10-11-2010 02:16 PM
Is it possible to read the IP address of the client accessing a RESTfull webservice built in LV? For example, one might want to identify users from local IP addresses and output different information.
Solved! Go to Solution.
10-12-2010 11:03 AM
InfiniteNothing,
Hello! Though I'm no expert at webservices, I'm pretty sure the only way for you to get the IP address of the client accessing your webservice is for the client to send it as part of the call to the webservice itself. I hope this helps!
10-12-2010 11:27 AM
In a case like the weather service it would require that the user knew their IP address and wouldn't lie. I'd rather I could do this from the server side.
10-13-2010 11:15 AM
InfiniteNothing,
I see your point! I did not intend to say that the user would providing the IP address via manual entry. What I was trying to say was that your Thin Client program should have the ability to obtain the IP address of the user that accesses it and send that information to your LabVIEW Webservice.
10-13-2010 11:36 AM
In a case like the weather station example, there is no thin client. The web service is accessed directly.
10-15-2010 11:35 AM
InfiniteNothing,
Ah, Yes, Looking at that example I see what you are saying. My understanding is that the typical/suggeted use case for webservices is to have a thin client that makes the calls to the webservice instead of the user making the call like the weather station example does. I'll keep looking to verify that you can/can't get the IP address from the webservice itself.
10-15-2010 12:48 PM
InfiniteNothing,
Allright, I think I've found somthing.
Among the Web Wervices VIs, there is a VI called Read Request Variable. One of the variables that you can read is Remote Address and I think this will give you the IP Address. To use these VIs you'll have to use the streaming method of getting data instead of reading terminals (as the example does).
I hope this helps!