views:

46

answers:

1

I'm creating a webservice.
I wanna recover the URL that is used my webservice.

e.g:
Someone from www.sth.com invoke my webservice's methods. Now I wanna recover www.sth.com from my webservice!

Is it possible? if so, how?

+2  A: 

try using:

string clientAddress = this.Context.Request.UserHostAddress;
Nissim
If this helped you, please accept this by marking it as accepted answer
Nissim
It returns IP! I want the URL, e.g: http://stackoverflow.com/questions/3572485/recover-the-url-that-is-used-my-webservice
Mohammad
You can't recover the 'calling' site (unless the site pass you this information in the context, which most sites don't do). Most of the time, when a webmaster wants to know from where the user got to your site - he ask him (look here for example: 'http://www.threadsoftime.com/Merchant2/info/where_popup.shtml'. This is one of many... it is a conventional method for doing this)
Nissim