How do I get the caller\'s IP address in a WebMethod?
[WebMethod] public void Foo() { // HttpRequest... ? - Not giving me any options through intellisens
The HttpContext is actually available inside the WebService base class, so just use Context.Request (or HttpContext.Current which also points to the current context) to get access to the members provided by the HttpRequest.
WebService
Context.Request
HttpContext.Current
HttpRequest