1

「WCF4.0 の新機能」チュートリアルを実行します。最初の演習は、構成なしでサービスをセットアップすることです。次に、サービス メタデータを提供するための構成を配置します。シンプルなもの。

私が今やろうとしているのは、構成を拡張して、同じサービス コントラクトを別のポートで公開することです。この場合はhttp://localhost:9001/test です。

これは私の設定です...

<system.serviceModel>
    <behaviors>
        <serviceBehaviors>
            <behavior name="WCF4Configuration.EchoServiceBehavior">
                <serviceMetadata httpGetEnabled="true" />
                <serviceDebug includeExceptionDetailInFaults="false" />
            </behavior>
        </serviceBehaviors>
    </behaviors>
    <services>
        <service behaviorConfiguration="WCF4Configuration.EchoServiceBehavior" name="WCF4Configuration.EchoService">
            <endpoint address="" binding="wsHttpBinding" contract="WCF4Configuration.IEchoService">
                <identity>
                    <dns value="localhost" />
                </identity>
            </endpoint>                              
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
          <endpoint address="http://localhost:9001/test" binding="wsHttpBinding" contract="WCF4Configuration.IEchoService"/>
        </service>
    </services>
</system.serviceModel>

ただし、これに接続しようとすると、マシンが積極的に接続を拒否したというメッセージが表示されます。なぜこれが機能しないのですか?また、サービスを表示するために wcftestclient で使用できるアドレスは何ですか?

4

1 に答える 1

0

試す:

<services>
        <service behaviorConfiguration="WCF4Configuration.EchoServiceBehavior" name="WCF4Configuration.EchoService">
            <endpoint address="" binding="wsHttpBinding" contract="WCF4Configuration.IEchoService">
                <identity>
                    <dns value="localhost" />
                </identity>
            </endpoint>                              
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
          <endpoint address="" binding="wsHttpBinding" contract="WCF4Configuration.IEchoService">
           <host>
            <baseAddresses>
              <add baseAddress="http://localhost:9001/test/" />
            </baseAddresses> 
          </endpoint>
        </service>
</services>
于 2011-04-05T20:02:24.493 に答える