简体   繁体   English

WCF:找不到与绑定WebHttpBinding的端点的方案http匹配的基地址。 注册的基址方案为[https]

[英]WCF: Could not find a base address that matches scheme http for the endpoint with binding WebHttpBinding. Registered base address schemes are [https]

I hava wcf service built with framework 4. and hosted to IIS using https. 我有使用框架4构建的wcf服务,并使用https托管到IIS。

below is my configuration file and error i got 以下是我的配置文件和错误

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.web>
    <customErrors mode="Off"/>
    <compilation debug="true" targetFramework="4.0" />
    <httpRuntime />
    <pages controlRenderingCompatibilityVersion="4.0" />
  </system.web>
  <system.serviceModel>
    <services>
      <service name="WebService.Service1">
        <endpoint address="" binding="webHttpBinding" contract="WebService.IService1" bindingConfiguration="LargeWeb" behaviorConfiguration="webBehavior" />
        <endpoint address="h" binding="basicHttpBinding" contract="WebService.IService1" bindingConfiguration="" behaviorConfiguration="" />

        <endpoint address="" binding="basicHttpBinding" bindingConfiguration="secureHttpBinding" contract="WebService.IService1"/>
        <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="webBehavior">
          <webHttp />
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <protocolMapping>
      <add binding="basicHttpsBinding" scheme="https" />
    </protocolMapping>
    <bindings>
      <basicHttpBinding>
        <binding name="secureHttpBinding">
          <security mode="Transport">
            <transport clientCredentialType="None"/>
          </security>
        </binding>
      </basicHttpBinding>

      <webHttpBinding>
        <binding name="LargeWeb" maxBufferPoolSize="20000000" maxReceivedMessageSize="20000000" maxBufferSize="20000000">
          <readerQuotas maxArrayLength="20000000" maxBytesPerRead="20000000" maxDepth="32" maxNameTableCharCount="20000000" maxStringContentLength="20000000" />
        </binding>
      </webHttpBinding>
    </bindings>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true" />
    <directoryBrowse enabled="false" />
  </system.webServer>
</configuration>

Error Returned 错误返回

Could not find a base address that matches scheme http for the endpoint with binding WebHttpBinding. Registered base address schemes are [https].
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.InvalidOperationException: Could not find a base address that matches scheme http for the endpoint with binding WebHttpBinding. Registered base address schemes are [https].

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Going out on a limb here... 在这里走出去...

Based on your configuration file and the error message you're receiving, it appears you need to set the security mode of your webHttpBinding to Transport . 根据您的配置文件和收到的错误消息,您似乎需要将webHttpBindingsecurity模式设置为Transport

You can see from the documentation, by default the security property on a WebHttpBinding is None. 您可以从文档中看到,默认情况下, WebHttpBindingsecurity属性为None。

To use the HTTPS protocol, you would need to set the security mode to Transport 要使用HTTPS协议,您需要将security模式设置为“ Transport

The configuration for your WebHttpBinding would be as follows: WebHttpBinding的配置如下:

<webHttpBinding>
     <binding name="LargeWeb" maxBufferPoolSize="20000000" maxReceivedMessageSize="20000000" maxBufferSize="20000000">
         <readerQuotas maxArrayLength="20000000" maxBytesPerRead="20000000" maxDepth="32" maxNameTableCharCount="20000000" maxStringContentLength="20000000" />
         <security mode="Transport">
     </binding>
</webHttpBinding>

暂无
暂无

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

相关问题 从 http 到 https,得到“找不到与具有绑定 WebHttpBinding 的端点的方案 http 匹配的基地址” - Going from http to https, getting "Could not find a base address that matches scheme http for the endpoint with binding WebHttpBinding" WCF-找不到与https端点的方案http匹配的基地址 - WCF - Could not find a base address that matches scheme http for the https endpoint 找不到与绑定WSHttpBinding的端点的scheme http匹配的基址 - Could not find a base address that matches scheme http for the endpoint with binding WSHttpBinding 找不到与绑定MetadataExchangeTcpBinding自托管端点的终结点计算机匹配方案net.tcp的基地址 - Could not find a base address that matches scheme net.tcp for the endpoint with binding MetadataExchangeTcpBinding self hosting 找不到与绑定MetadataExchangeTcpBinding的端点的方案net.tcp匹配的基地址 - Could not find a base address that matches scheme net.tcp for the endpoint with binding MetadataExchangeTcpBinding WCF 服务基地址与端点地址 - WCF Service Base Address vs endpoint address WCF服务基地址Http和netTcp - WCF Service Base Address Http and netTcp 无论使用何种绑定,WCF相对端点地址都在所有基址上公开 - WCF relative endpoint address exposed over all base addresses no matter binding used WCF:没有协议绑定与给定地址匹配 - WCF: No protocol binding matches the given address webHttpBinding WCF服务通过HTTP响应,但不通过HTTPS响应 - webHttpBinding WCF service responds over HTTP but not HTTPS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM