Question

I have created a WCFLibrary which has :

   [OperationContract]
   string TestCall();

And my app.config has this :

  <endpoint address="" binding="wsHttpBinding" contract="TestWCF.ITestService">
      <identity>
        <dns value="localhost" />
      </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    <host>
      <baseAddresses>
        <add baseAddress="http://localhost:8732/Design_Time_Addresses/TestWCF/TestService/" />
      </baseAddresses>
    </host>

My Windowsservice has this :

   protected override void OnStart(string[] args)
    {
        host = new ServiceHost(typeof(TestWCF.TestService));
    }

Have compiled exe and installed it as a service everything is fine till this point.

Now I wanted to check this url from browser :

*http://localhost:8732/Design_Time_Addresses/TestWCF/TestService*

but due to some reasons I cant make a call to my WCF hosted in Windows Service, What might be went wrong am I missing anything ?

Was it helpful?

Solution

protected override void OnStart(string[] args)
{
    host = new ServiceHost(typeof(TestWCF.TestService));
    host.Open(); // :-)
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top