R
Roger Down
I have used the SoapDocumentMethod(OneWay=true) on a web service.
Inside all my web services, I want to know who is accessing the respective
web service methods.
So I used the following two lines for this:
HttpContext httpContext = HttpContext.Current;
string userHostAddress = httpContext.Request.UserHostAddress;
When using this on a web service method not using the OneWay=true attribute,
everything works fine.
But on those web service methods where OneWay=true is added, I get the
following exception...:
Object reference not set to an instance of an object.
at
System.Web.Hosting.ISAPIWorkerRequestInProc.GetAdditionalServerVar(Int32
index)
at System.Web.Hosting.ISAPIWorkerRequestInProc.GetServerVariable(String
name)
at System.Web.Hosting.ISAPIWorkerRequest.GetRemoteAddress()
at System.Web.HttpRequest.get_UserHostAddress()
Is this by design or is this a bug ?
Are there other ways of getting the client ip address when using the
OneWay=true ?
Best of regards...
Inside all my web services, I want to know who is accessing the respective
web service methods.
So I used the following two lines for this:
HttpContext httpContext = HttpContext.Current;
string userHostAddress = httpContext.Request.UserHostAddress;
When using this on a web service method not using the OneWay=true attribute,
everything works fine.
But on those web service methods where OneWay=true is added, I get the
following exception...:
Object reference not set to an instance of an object.
at
System.Web.Hosting.ISAPIWorkerRequestInProc.GetAdditionalServerVar(Int32
index)
at System.Web.Hosting.ISAPIWorkerRequestInProc.GetServerVariable(String
name)
at System.Web.Hosting.ISAPIWorkerRequest.GetRemoteAddress()
at System.Web.HttpRequest.get_UserHostAddress()
Is this by design or is this a bug ?
Are there other ways of getting the client ip address when using the
OneWay=true ?
Best of regards...