0

私は次のようなWCFLibraryを作成しました:

   [OperationContract]
   string TestCall();

そして私のapp.configにはこれがあります:

  <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>

私のWindowsサービスにはこれがあります:

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

exeをコンパイルし、サービスとしてインストールしました。この時点まではすべて問題ありません。

今、私はブラウザからこのURLをチェックしたかった:

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

しかし、いくつかの理由により、WindowsサービスでホストされているWCFに電話をかけることができません。何かが足りない場合、何が問題になる可能性がありますか?

4

1 に答える 1

2
protected override void OnStart(string[] args)
{
    host = new ServiceHost(typeof(TestWCF.TestService));
    host.Open(); // :-)
}
于 2012-10-04T09:02:00.383 に答える