all groups > asp.net webservices > september 2007 >
You're in the

asp.net webservices

group:

OneWay=true causes exception


OneWay=true causes exception Roger Down
9/28/2007 12:38:58 PM
asp.net webservices:
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...

RE: OneWay=true causes exception Som Nath Shukla
10/3/2007 3:16:00 AM
hi
u can use only onway=true when ur webmethod return type is void plz see
it. and send the signature of webmethod.


[quoted text, click to view]
AddThis Social Bookmark Button