![](/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]
[英]Https and Could not find a base address that matches scheme https for the endpoint with binding WSHttpBinding
我在Windows Server 2012的IIS網站中托管了WCF服務。
網站綁定只有
https myhostname.labsoa 443
我在IExplorer中調用URL https://myhostname.labsoa/RoutingService.svc
我只想使用https呼叫Wcf服務
注意:將實際值替換為myhostname.labsoa
我收到消息錯誤:
找不到與綁定WSHttpBinding的端點的方案http匹配的基地址。 注冊的基址方案為[https]
在WCF服務主機中,我具有以下配置文件:
web.config中
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5"/>
<customErrors mode="Off"></customErrors>
</system.web>
<system.serviceModel>
<bindings configSource="Config\system.serviceModel.bindings.config"/>
<services configSource="Config\system.serviceModel.services.config"/>
<behaviors configSource="Config\system.serviceModel.behaviors.config"/>
<client configSource="Config\system.serviceModel.client.config"/>
<routing configSource="Config\system.serviceModel.routing.config"/>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment
aspNetCompatibilityEnabled="false"
multipleSiteBindingsEnabled="true" />
</system.serviceModel>
配置\\ system.serviceModel.behaviors.config
<behaviors>
<serviceBehaviors>
<behavior name="routingData">
<serviceMetadata httpGetEnabled="True"
httpsGetEnabled="true" />
<routing filterTableName="routingTable1" routeOnHeadersOnly="false" />
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
配置\\ system.serviceModel.bindings.config
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_Default" closeTimeout="00:05:00"
openTimeout="00:05:00" receiveTimeout="00:10:00" sendTimeout="00:05:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="Transport">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
<wsHttpBinding>
<binding name="wsHttpBinding_Default" maxReceivedMessageSize="2147483647">
<security mode="Transport">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
</security>
</binding>
</wsHttpBinding>
</bindings>
配置\\ system.serviceModel.services.config
<services>
<service behaviorConfiguration="routingData"
name="System.ServiceModel.Routing.RoutingService">
<host>
<baseAddresses>
<add baseAddress="https://myhostname.labsoa/RoutingService.svc"/>
</baseAddresses>
</host>
<endpoint address=""
binding="wsHttpBinding"
name="reqReplyEndpoint"
contract="System.ServiceModel.Routing.IRequestReplyRouter" />
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
<endpoint
address="/Contacto"
binding="wsHttpBinding"
contract="System.ServiceModel.Routing.IRequestReplyRouter"
name="ContactoRouting"
bindingConfiguration="wsHttpBinding_Default"
/>
有什么建議嗎?
您的終端配置沒有bindinginConfiguration。 以下配置
<endpoint address=""
binding="wsHttpBinding"
name="reqReplyEndpoint"
contract="System.ServiceModel.Routing.IRequestReplyRouter" />
應該
<endpoint address=""
binding="wsHttpBinding"
name="reqReplyEndpoint"
bindingConfiguration="wsHttpBinding_Default"
contract="System.ServiceModel.Routing.IRequestReplyRouter" />
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.