Hi, I am writing my first WCF service. I want to log the service endpoint to a log file. My code looks like this:
public class MyWCFService : ServiceBase
public ServiceHost serviceHost = null;
protected override void OnStart(String args)
if (serviceHost != null)
serviceHost = new ServiceHost(typeof(.....));
String info = "web service starting at uri:";
info = info + "http://localhost:8773/MyWCFService/";
I want to retrieve the "http://localhost:8773/MyWCFService/
" bit from the application and log it to a file (it is hard coded there now in the example above).
What I DO NOT want is to read it in from App.Config !!!!
What I DO WANT is to retrieve the url in from something like OperationContext.Current.E
When I try OperationContext.Current.E
soluteUri I get null
If anyone has a suggestion it would be really welcome.
My WCF Service is based on this example: LinkToMicrosoftWCFService