[英]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
. 根据您的配置文件和收到的错误消息,您似乎需要将
webHttpBinding
的security
模式设置为Transport
。
You can see from the documentation, by default the security
property on a WebHttpBinding is None. 您可以从文档中看到,默认情况下, WebHttpBinding的
security
属性为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.