tags:

views:

36

answers:

1

Hi

I'm working on a wcf service and I have the need for it to figure out it's own endpoint address (pref. in the constructor). Is this possible and if so, could anyone point me to the right direction? The service is hosted on IIS.

Thanks.

A: 
var uri = OperationContext
    .Current
    .EndpointDispatcher
    .EndpointAddress
    .Uri;
Darin Dimitrov
I tried this, but it throws an NullReferenceException (OperationContext.Current is apparently null for some reason).Strangely enough, it seems to work on a self hosted application... Any suggestions?
Hoblaa