2

単純なWCFサービス用の非常に単純なコンソールベースのホストがあります。サービスのアプリ構成は次のとおりです。

<system.serviceModel>
    <services>
      <service name="MagicEightBallServiceLib.MagicEightBallService"
               behaviorConfiguration="EightBallServiceMEXBehavior">
        <endpoint address=""
                  binding = "basicHttpBinding"
                  contract = "MagicEightBallServiceLib.IEightBall" />
        <!-- Enable the MEX endpoint-->
      <endpoint address="mex"
                binding ="mexHttpBinding"
                contract ="IMetadataExchange" />
      <!--Need to add this so MEX knows the address of our service -->
      <host>
        <baseAddresses>
          <add baseAddress="http://localhost:8080/MagicEightBallService"/>
        </baseAddresses>
      </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="EightBallServiceMEXBehavior">
          <serviceMetadata httpGetEnabled="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

ホストプログラムは完全に実行されていることを示しています。 **コンソールベースのWCFホスト*

***** Host Info ******
Address: http://localhost:8080/MagicEightBallService
Binding: BasicHttpBinding
Contract: IEightBall

Address: http://localhost:8080/MagicEightBallService/mex
Binding: MetadataExchangeHttpBinding
Contract: IMetadataExchange

**************************************************
The service is ready

プロキシを参照または生成しようとすると、次のようになります。HTTPエラー404.0-見つかりません

何が悪いのかわかりません。これ以上簡単なものはありません!

4

2 に答える 2

0

localhost:8080 を使用する代わりに、127.0.0.1:8080 を使用します。これが、Windows 10 マシンで動作する例を取得した方法です。

于 2016-12-20T21:52:18.763 に答える