1

IIS7でnet.tcpを使用するようにwcfサービスをセットアップしようとしています。

これが私が得るエラーです:

メッセージを受け入れることができるnet.tcp://127.0.0.1:8000/ListingServiceでリッスンしているエンドポイントはありませんでした。これは多くの場合、誤ったアドレスまたはSOAPアクションが原因で発生します。詳細については、InnerException(存在する場合)を参照してください。

クライアントから呼び出すコードは次のとおりです。

using (var client = new ListingServiceClient("NetTcpBinding"))
{
   client.Test();
   client.Close();
}

これが私のサービスweb.configです-http ://pastebin.com/3S8BZbup

<system.serviceModel>
    <bindings>
      <netTcpBinding>
        <binding portSharingEnabled="true">
          <security mode="None" />
        </binding>
      </netTcpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="default">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
          <!--throttle service-->
          <serviceThrottling
            maxConcurrentCalls="10000"
            maxConcurrentSessions="10000" 
            maxConcurrentInstances="10000" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <services>
      <service behaviorConfiguration="default" name="Housters.Services.ListingService">
        <endpoint name="TcpEndpoint"
                  address="net.tcp://127.0.0.1:8000/ListingService"
                  binding="netTcpBinding"
                  contract="Housters.Services.IListingService" />
      </service>
    </services>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
  <system.webServer>
      <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

そして、これが私のクライアントapp.configです-http ://pastebin.com/YpiAhh46

<system.serviceModel>
    <bindings>
      <netTcpBinding>
        <binding name="NetTcpBinding">
          <security mode="None"/>
        </binding>
      </netTcpBinding>
    </bindings>
    <client>
      <endpoint
              address="net.tcp://127.0.0.1:8000/ListingService"
              binding="netTcpBinding" bindingConfiguration="NetTcpBinding"
              contract="ListingServiceProxy.IListingService" name="NetTcpBinding" />
    </client>
  </system.serviceModel>

何か案は?

4

1 に答える 1

7

この構成は、IIS/WAS では機能しません。IIS でホストする場合、.svc ファイル (または WCF 4 での構成ベースのアクティブ化) が必要であり、エンドポイントのアドレスは常に VirtualDirectoryPath + SvcFile + エンドポイント構成で指定された相対アドレスです。エンドポイント構成での絶対アドレスの設定は、セルフ ホスティング用です。

于 2011-01-28T00:15:49.490 に答える