我知道有很多这方面的问题,我试过它们并且它没有用......我在WS8上使用IIS8,将net.tcp添加到协议列表并绑定到808,我仍然收到此错误:
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 : http://192.168.1.101:64410/eve/relay/ClientRelayService.svc : http://192.168.1.101:64410/eve/relay/ClientRelayService.svc
我在一个端口为64410的站点上运行了2个测试服务(一个是basichttp,另一个应该是tcp)。其他服务正常运行。
这是我的服务器端配置:
<?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>I know there are many questions about this, I'we tried them all and it didn't work... I'm using IIS8 on WS8, added net.tcp to protocols list and binding to 808 and I still get this error:
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].I'm trying to open service in browser using: http://192.168.1.101:64410/eve/relay/ClientRelayService.svc
I'm runing 2 test services (one is basichttp and other should be tcp) on a site with port 64410. Other service is working as should.
Here's mine server side config:
<?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>最满意答案
我将使用net.tcp绑定从服务中删除基地址,并在其端点上显式定义地址,如
<endpoint address="net.tcp://localhost:808/eve/relay/ClientRelayService.svc" binding="netTcpBinding" bindingConfiguration="tcpBinding" contract="Eve.API.Services.Contracts.Services.Interfaces.IRelayService">I'd remove base address from service with net.tcp binding, and define address explicitly on it's endpoint, like
<endpoint address="net.tcp://localhost:808/eve/relay/ClientRelayService.svc" binding="netTcpBinding" bindingConfiguration="tcpBinding" contract="Eve.API.Services.Contracts.Services.Interfaces.IRelayService">更多推荐
tcp,true,binding,电脑培训,计算机培训,IT培训"/> <meta name="description&
发布评论