Source of a web service request

B

BillGatesFan

Is there anyway to tell when a web service is called, where the call
came from? Like IP address. In the code?

I have a web service where I would like to know where the call came
from then I want to do something different if the call came from a
certain IP address.


Thanks
 
J

John Saunders [MVP]

BillGatesFan said:
Is there anyway to tell when a web service is called, where the call
came from? Like IP address. In the code?

I have a web service where I would like to know where the call came
from then I want to do something different if the call came from a
certain IP address.

Try Context.Request.UserHostAddress.

I presume you're aware that an IP address may not be a good identifier of a
particular machine? It can change, it can be the address of a NAT box or
proxy, etc. Instead, if you want to identify a caller, it should be with an
identification schema that you design. For instance, require the client to
send you a particular certificate, or to send you some information with a
digital signature.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,814
Latest member
SpicetreeDigital

Latest Threads

Top