![](/img/trans.png)
[英]Could not find a base address that matches scheme http for the endpoint with binding WSHttpBinding. Registered base address schemes are [https]
[英]Could not find a base address that matches scheme https for the endpoint with binding BasicHttpBinding. Registered base address schemes are http
我根據下面的鏈接編寫了一個SL + WCF用戶名密碼授權演示,但是我無法擺脫它。
我的Web.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<services>
<service name="Sample.Web.Service" behaviorConfiguration="ServiceBehavior" >
<host>
<baseAddresses>
<add baseAddress="https://localhost"/>
</baseAddresses>
</host>
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="test" contract="Sample.Web.IService">
<identity>
<
dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="test">
<security mode="TransportWithMessageCredential">
<message clientCredentialType="UserName"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceMetadata />
<serviceDebug includeExceptionDetailInFaults="false" />
<serviceCredentials>
<userNameAuthentication userNamePasswordValidationMode="Custom"
customUserNamePasswordValidatorType="Sample.Web.MyValidator, Sample.Web"/>
</serviceCredentials>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
希望有人可以幫忙。 提前致謝!。
之所以收到此異常,是因為您尚未在計算機上配置IIS來支持承載此應用程序的網站的HTTPS。 使用此指定的安全選項時,WCF需要安全的HTTP連接。 您需要在IIS上為所涉及的網站映射服務證書。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.