I have a web service that is configured as one way. Or rather, the SoapDocumentMethod attribute has a property that is called "OneWay". That is set to true.
I'm trying to get the IP address of the client request. I get the fact that I won't get the exact IP address because the client may be behind other networking concepts. That's irrelevant. I want an IP address of whoever initiated the call on the service, so if that's some front end server sitting on top of some clients machine, so be it.
I tried using HttpContext, but that doesn't seem to work. If I hit my web service on the same machine as the web service is running, then HttpContext is populated and I can get the IP address. However, any external use of my web service and the HttpContext is a little messed up. It throws exceptions on many of the properties when trying to find out information on the request. So I cannot get the client IP address. If you enable tracing of the service, It then starts working. But that's only a temporary work around. It's not an acceptable solution.
So.. what's the best way to get the client IP address when you have a one way web service?
I've already looked here: http://msdn.microsoft.com/en-us/library/system.web.services.protocols.soapdocumentmethodattribute.oneway.aspx