我们创建了WCF服务,并且能够在本地使用。 当它在IIS上发布并以https形式使用时,出现以下错误
找不到与方案http匹配的基地址 具有绑定WSHttpBinding的端点。注册基址方案 是[https]。
配置文件
<?xml version="1.0"?> <configuration>
<appSettings>
<add key="aspnet:UsetaskFriendlySynchronizationContext" value="true" /> </appSettings> <system.web>
<compilation debug="true" targetFramework="4.5" />
<httpruntime targetFramework="4.5"/> </system.web> <system.serviceModel>
<services>
<service name="WCF_Portal_Service.Portal">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration=""
contract="WCF_Portal_Service.IPortal" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information,set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes,set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<servicehostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> </system.serviceModel> <system.webServer>
<modules runAllManagedmodulesForAllRequests="true"/>
<!--
To browse web app root directory during debugging,set the value below to true.
Set to false before deployment to avoid disclosing web app folder information.
-->
<directoryBrowse enabled="true"/> </system.webServer>
</configuration>