client IP address in a web service

  • Thread starter Thread starter tim djossou
  • Start date Start date
T

tim djossou

Hi

Is there a way to get the IP address of the client who is using a web
service (inside the web service?)

Regards
 
Tim,

Yous hould be able to get this using the UserHostAddress property on the
HttpRequest class. You can get this in a web service using the following:

// Get the context.
string pstrClientAddress = HttpContext.Current.Request.UserHostAddress;

Hope this helps.
 
Back
Top