469,283 Members | 2,303 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,283 developers. It's quick & easy.

how to determine hosted server url from within wcf service?

Hi, I've got a wcf service that is hosted on my local machine. I need to
determine the hosted url of the service from within the service but cannot
work out how to do it.
HttpContext.Current always returns null, which i suppose might make some
sense. Does anyone know of a way to get the url?

TIA,

paul
Apr 2 '08 #1
5 9330
paul korosi wrote:
Hi, I've got a wcf service that is hosted on my local machine. I need to
determine the hosted url of the service from within the service but cannot
work out how to do it.
HttpContext.Current always returns null, which i suppose might make some
sense. Does anyone know of a way to get the url?

TIA,

paul

Where did you host your service? A Windows service, IIS or normal
program (console or winform)?

--
Thanks,
Duy Lam Phuong
Apr 2 '08 #2
"Duy Lam" <du**********@gmail.comwrote in message
news:e4**************@TK2MSFTNGP05.phx.gbl...
paul korosi wrote:
>Hi, I've got a wcf service that is hosted on my local machine. I need to
determine the hosted url of the service from within the service but
cannot work out how to do it.
HttpContext.Current always returns null, which i suppose might make some
sense. Does anyone know of a way to get the url?

TIA,

paul

Where did you host your service? A Windows service, IIS or normal program
(console or winform)?

--
Thanks,
Duy Lam Phuong
sorry - should have said. it's hosted on IIS.

cheers,

paul
Apr 3 '08 #3
Uri uri = OperationContext.Current.IncomingMessageHeaders.To ;

Marc
Apr 3 '08 #4
"Marc Gravell" <ma**********@gmail.comwrote in message
news:%2***************@TK2MSFTNGP05.phx.gbl...
Uri uri = OperationContext.Current.IncomingMessageHeaders.To ;

Marc
Thanks Marc - you're a champ.
Apr 4 '08 #5
No problem; sorry the reply was so terse, but I was in a hurry...

Marc
Apr 4 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Chris Podmore | last post: by
1 post views Thread by Newbie | last post: by
1 post views Thread by aj | last post: by
1 post views Thread by CARIGAR | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.