I have an IIS hosted WCF service (configured as described in this blog post ... I need to know what the configured endpoint's URL is. For example, given this configuration:
<system.serviceModel>
<services>
<service behaviorConfiguration="mexBehavior" name="Sc.Neo.Bus.Server.MessageProxy">
<endpoint address="http://localhost:9000/MessageProxy.svc" binding="basicHttpBinding"
contract="Sc.Neo.Bus.IMessageProxy" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="BusWeb.Service1Behavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
<behavior name="mexBehavior">
<serviceMetadata httpGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
I'd like to be able to get the value 'http://localhost:9000/MessageProxy.svc
' into a string variable in the web application's onstart event.