Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > OneWay=true causes exception

Reply
Thread Tools

OneWay=true causes exception

 
 
Roger Down
Guest
Posts: n/a
 
      09-28-2007
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.GetAdd itionalServerVar(Int32
index)
at System.Web.Hosting.ISAPIWorkerRequestInProc.GetSer verVariable(String
name)
at System.Web.Hosting.ISAPIWorkerRequest.GetRemoteAdd ress()
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...


 
Reply With Quote
 
 
 
 
Som Nath Shukla
Guest
Posts: n/a
 
      10-03-2007
hi
u can use only onway=true when ur webmethod return type is void plz see
it. and send the signature of webmethod.


"Roger Down" wrote:

> 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.GetAdd itionalServerVar(Int32
> index)
> at System.Web.Hosting.ISAPIWorkerRequestInProc.GetSer verVariable(String
> name)
> at System.Web.Hosting.ISAPIWorkerRequest.GetRemoteAdd ress()
> 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...
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exception of type 'System.Web.HttpUnhandledException' wasthrown.Exception has been thrown by the target of an invocation.System.WebSystem.Exception jobs ASP .Net 1 11-16-2007 05:57 PM
while executing my client program i get the exception javax.naming.LinkException: [Root exception is javax.naming.LinkException: [Root exception is javax.naming.NameNotFoundException: remaining if plz anybody know how to solve this problem then mahesh Java 0 03-08-2007 12:26 PM
SmtpMail.Send causes exception: Error loading type library/dll Diego F. ASP .Net 1 06-06-2005 11:50 AM
HttpWebRequest.GetRequestStream Causes an Exception Jason ASP .Net 3 03-17-2005 11:26 PM
Postback causes 100=Continue, causes double download prompt? Xavier Osa ASP .Net 0 01-09-2004 11:17 AM



Advertisments