![](/img/trans.png)
[英]WCF: Could not find a base address that matches scheme http for the endpoint with binding WebHttpBinding. Registered base address schemes are [https]
[英]WCF - Could not find a base address that matches scheme http for the https endpoint
當我嘗試運行我的服務時,出現以下錯誤:“找不到與綁定BasicHttpBinding的端點的方案http匹配的基地址。注冊的基地址方案為[https]。”
我的服務聲明:
<service name="service" behaviorConfiguration="serviceEndpointBehavior">
<host>
<baseAddresses>
<add baseAddress="https://abc:12704/service"/>
</baseAddresses>
</host>
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="basicHttpBinding2" contract="service"/>
<endpoint address="mex" contract="IMetadataExchange" binding="basicHttpBinding"/>
</service>
捆綁:
<basicHttpBinding>
<binding name="basicHttpBinding2" maxReceivedMessageSize="1000000">
<readerQuotas maxArrayLength="1000000" maxStringContentLength="1000000"/>
</binding>
</basicHttpBinding>
我也有以下行為聲明:
<behavior name="serviceEndpointBehavior">
<dataContractSerializer maxItemsInObjectGraph="1000000"/>
<serviceMetadata httpsGetEnabled="true" />
</behavior>
有任何想法嗎?
您定義的綁定是基本的http綁定。 您的端點是具有更高安全性(https)的http。 您需要在綁定上定義安全性,否則它們將不匹配。 沒有任何安全性就不能擁有https。
您需要找到一本很好的教程或書籍,因為https的內容比配置文件中的幾個條目還要多。 您將需要一個證書,並且您將需要一個實際執行此操作的Web服務器(提示:Cassini,內置VS Web服務器將不執行任何https ...操作,將其丟棄而不會發出任何警告)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.