2013-04-20 86 views
0

我知道有很多关于这方面的问题,我试过它们,它不工作... 我在WS8上使用IIS8,将net.tcp添加到协议列表并结合808,我仍然得到这个错误:IIS WCF net.tcp绑定错误

System.InvalidOperationException: Could not find a base address that matches scheme net.tcp for the endpoint with binding NetTcpBinding. Registered base address schemes are [http]. 

我试图用浏览器打开服务:http://192.168.1.101:64410/eve/relay/ClientRelayService.svc

我乳宁2个测试服务(一个是basichttp和其他应是tcp )在一个端口为64410的站点上。其他服务正在按照应该工作。

这里是我的服务器端配置:

<?xml version="1.0"?> 
<configuration> 
    <appSettings/> 
    <system.web> 
     <compilation debug="true" targetFramework="4.0"/> 
     <customErrors mode="Off"/> 
     <trust level="Full" /> 
     <httpRuntime/> 
    </system.web> 
    <system.serviceModel> 
     <bindings> 
      <netTcpBinding> 
       <binding name="tcpBinding" transferMode="Streamed" portSharingEnabled="true"> 
        <reliableSession enabled="true" /> 
        <security mode="None"> 
         <transport clientCredentialType="None" protectionLevel="None" /> 
         <message clientCredentialType="None" /> 
        </security> 
       </binding> 
      </netTcpBinding> 
     </bindings> 

     <services> 

      <service name="Eve.API.Services.Relay.RemoteRelayService"> 
       <host> 
        <baseAddresses> 
         <add baseAddress="http://localhost:64410/eve/relay/" /> 
        </baseAddresses> 
       </host> 
       <endpoint address="" binding="basicHttpBinding" contract="Eve.API.Services.Contracts.Services.Interfaces.IEveAPIService"/> 
       <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> 
      </service> 

      <service name="Eve.API.Services.Relay.RelayService"> 
       <host> 
        <baseAddresses> 
         <add baseAddress="net.tcp://localhost:808/eve/relay/ClientRelayService.svc"/> 
        </baseAddresses> 
       </host> 
       <endpoint address="" binding="netTcpBinding" bindingConfiguration="tcpBinding" contract="Eve.API.Services.Contracts.Services.Interfaces.IRelayService"> 
        <identity> 
         <dns value="localhost" /> 
        </identity> 
       </endpoint> 
       <endpoint address="tcpmex" binding="mexTcpBinding" contract="IMetadataExchange"/> 
       <!--<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>--> 
      </service> 

     </services> 
     <behaviors> 
      <serviceBehaviors> 
       <behavior> 
        <!-- TODO Set to false on deploy --> 
        <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/> 
        <serviceDebug includeExceptionDetailInFaults="true"/> 
       </behavior> 
      </serviceBehaviors> 
     </behaviors> 
     <protocolMapping> 
      <add binding="basicHttpsBinding" scheme="https"/> 
     </protocolMapping> 
     <serviceHostingEnvironment aspNetCompatibilityEnabled="true" minFreeMemoryPercentageToActivateService="1" multipleSiteBindingsEnabled="true"/> 
    </system.serviceModel> 
    <system.webServer> 
     <modules runAllManagedModulesForAllRequests="true"/> 
     <!-- TODO Set to false on deploy --> 
     <directoryBrowse enabled="true"/> 
    </system.webServer> 
</configuration> 
+0

有你尝试更改NetTCP绑定的端口?我不是100%确定http和net.tcp可以通过IIS共享相同的端口。 – Tim 2013-04-21 04:04:52

回答

0

我会从服务与net.tcp绑定就可以去除基址,并定义地址明确的终点,就像

<endpoint address="net.tcp://localhost:808/eve/relay/ClientRelayService.svc" 
    binding="netTcpBinding" bindingConfiguration="tcpBinding" 
    contract="Eve.API.Services.Contracts.Services.Interfaces.IRelayService">