简体   繁体   English

找不到与绑定 NetTcpBinding 的端点的方案 net.tcp 匹配的基地址。 基地址方案是 [http]

[英]Could not find a base address that matches scheme net.tcp for the endpoint with binding NetTcpBinding. Base address schemes are [http]

I have this configuration for my WCF service which runs on IIS Express port number 50187. The service is hosted on IIS Express of Visual Studio 2017:我的 WCF 服务有这个配置,它在 IIS Express 端口号 50187 上运行。该服务托管在 Visual Studio 2017 的 IIS Express 上:

<system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="QCConsumerBinding" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="50000000" maxBufferPoolSize="5242880" maxReceivedMessageSize="50000000" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
          <security mode="None">
            <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>
    <services>
      <service name="QCWCFService.QCService">
        <endpoint address="" binding="basicHttpBinding" bindingConfiguration="QCConsumerBinding" contract="QCWCFService.IQCService" />
      </service>
      <service name="QCWCFService.QCFinalService">
        <endpoint address="" binding="basicHttpBinding" bindingConfiguration="QCConsumerBinding" contract="QCWCFService.IQCFinalService" />
      </service>

      <service name="QCWCFService.CalibrationService">
        <endpoint address="service" binding="netTcpBinding" contract="QCWCFService.ICalibrationService" />
        <endpoint address="" binding="wsDualHttpBinding" contract="QCWCFService.ICalibrationService" />
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="net.tcp://localhost:8080/CalibrationService" />
            <add baseAddress="http://localhost:8081/CalibrationService" />
          </baseAddresses>

        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior>          
          <!-- To avoid disclosing metadata information, set the values below to false before deployment -->
          <serviceMetadata httpGetEnabled="true" />
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="true" />
          <dataContractSerializer maxItemsInObjectGraph="2147483647" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <protocolMapping>
      <add scheme="http" binding="wsDualHttpBinding" />
    </protocolMapping>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
  </system.serviceModel>

But when I try to run the service it gives this exception:但是当我尝试运行该服务时,它给出了这个异常:

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].

While I have another application with the same configuration for Dual Http Binding which works perfectly虽然我有另一个具有相同配置的双 Http 绑定应用程序,但它运行良好

By default, The IIS express doesn't support Net.tcp protocol.默认情况下,IIS express 不支持Net.tcp协议。 The service endpoint with Nettcpbinding requires a base address based on NetTcp protocol.具有Nettcpbinding的服务端点需要一个基于NetTcp协议的基地址。

<endpoint address="service" binding="netTcpBinding" contract="QCWCFService.ICalibrationService" />

Although we provide a Nettcp base address by using the Host Section , It won't work.尽管我们使用Host Section提供了Nettcp基址,但它不起作用。 This is due to the fact IIS express use self-configuration to provide a base address to run the current project.这是因为 IIS express 使用自配置来提供基​​地址来运行当前项目。 The configuration of IIS express usually located in the .vs folder of the current Solution, called applicationhost.config IIS express 的配置通常位于当前解决方案的 .vs 文件夹中,称为applicationhost.config
在此处输入图片说明
If we run this project in a console application with this configuration, it will work.如果我们在具有此配置的控制台应用程序中运行此项目,它将起作用。 Thereby we should provide one base address with Nettcp protocol.因此我们应该为 Nettcp 协议提供一个基地址。 This can be completed in IIS.这可以在 IIS 中完成。
1. Enable windows feature for net.tcp protocol. 1. 启用net.tcp协议的 windows 功能。
在此处输入图片说明
2. Add Net.tcp support on the website. 2.增加网站对Net.tcp支持。
在此处输入图片说明
3. Add net.tcp protocol in site binding module . 3.在site binding module添加net.tcp协议。
在此处输入图片说明
Please refer to the below for details of adding net.tcp protocol to a website.请参阅以下有关将net.tcp协议添加到网站的详细信息。
WCF ContractFilter Mismatch when enabling Reliable Session 启用可靠会话时 WCF ContractFilter 不匹配
Feel free to let me know if the problem still exists.如果问题仍然存在,请随时告诉我。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 找不到与端点的scheme net.tcp匹配的基址 - Could not find a base address that matches scheme net.tcp for the endpoint 找不到与绑定MetadataExchangeTcpBinding自托管端点的终结点计算机匹配方案net.tcp的基地址 - Could not find a base address that matches scheme net.tcp for the endpoint with binding MetadataExchangeTcpBinding self hosting 找不到与绑定WSHttpBinding的端点匹配方案http的基地址。 注册的基址方案为[https] - Could not find a base address that matches scheme http for the endpoint with binding WSHttpBinding. Registered base address schemes are [https] 找不到与绑定BasicHttpBinding的端点匹配方案https的基地址。 注册的基址方案是http - Could not find a base address that matches scheme https for the endpoint with binding BasicHttpBinding. Registered base address schemes are http 找不到与具有绑定 WebHttpBinding 的端点的方案 https 匹配的基址。 注册的基址方案是 [http] - Could not find a base address that matches scheme https for the endpoint with binding WebHttpBinding. Registered base address schemes are [http] 找不到与方案 net.tcp 匹配的基地址 - Could not find a base address that matches scheme net.tcp 例外:找不到与方案net.tcp匹配的基址 - Exception: Could not find a base address that matches scheme net.tcp 找不到与绑定WSHttpBinding的端点的scheme http匹配的基址 - Could not find a base address that matches scheme http for the endpoint with binding WSHttpBinding 找不到与绑定BasicHttpBinding的端点匹配方案http的基地址 - Could not find a base address that matches scheme http for the endpoint with binding BasicHttpBinding 找不到与绑定BasicHttpBinding的端点的方案https匹配的基址 - Could not find a base address that matches scheme https for the endpoint with binding BasicHttpBinding
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM