Hi guys,
I builded a ASMX Service and in the code that process an Error Log that comes from ELMAH. I add into the database all the fields and I add some more, one is the IP Address of the requested client...
But I can't (please read, don't know how to) get that...
I'm used to
string ipAddress = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (ipAddress == "") ipAddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
But off course here it does not apply because it's not an HTML request but a SOAP request
in ALL_HTTP header I get all this information:
HTTP_CONNECTION:Keep-Alive
HTTP_CONTENT_LENGTH:440331
HTTP_CONTENT_TYPE:text/xml; charset=utf-8
HTTP_EXPECT:100-continue
HTTP_HOST:www.mydomainname.com
HTTP_USER_AGENT:Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 2.0.50727.3074)
HTTP_VSDEBUGGERCAUSALITYDATA:uIDPowJ7s0UYlmhEqcDjxYQT/TQAAAAADlaOOkJ5DUizA7gKLg3YEPur8pFWlaVFmpinSAOBTuIACQAA
HTTP_SOAPACTION:"http://www. mydomainname.com/webservices/ErrorReportService/ReportErrors"
Where and how can I get the Requested IP?
Note that I'm not using any kind of authentication (yet) ... :)