2
我最近向我的WCF服務添加了HTTPS,該服務在我的開發IIS服務器上正常工作,適用於HTTP和HTTPS。但是,現在當我嘗試使用Visual Studio(本地主機),我越來越想打服務時,這個錯誤運行:由於SSL原因,WCF服務無法從Visual Studio工作
Exception: System.InvalidOperationException
Description: Could not find a base address that matches scheme https for the endpoint with binding WebHttpBinding. Registered base address schemes are [http].
Timestamp: 5/15/2013 4:23:04 PM
Client IP Address/DNS Name: ::1 - ::1
at System.ServiceModel.ServiceHostBase.MakeAbsoluteUri(Uri relativeOrAbsoluteUri, Binding binding, UriSchemeKeyedCollection baseAddresses)
at System.ServiceModel.Description.ConfigLoader.LoadServiceDescription(ServiceHostBase host, ServiceDescription description, ServiceElement serviceElement, Action`1 addBaseAddress, Boolean skipHost)
這裏是我的web.config:
<system.serviceModel>
<bindings>
<webHttpBinding>
<binding name="sslBinding">
<security mode="Transport">
<transport clientCredentialType="None" proxyCredentialType="None" />
</security>
</binding>
</webHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="ServiceBehavior" name="HistoryService">
<endpoint behaviorConfiguration="webHttp" binding="webHttpBinding" contract="IHistoryService" />
<endpoint binding="webHttpBinding" contract="IHistoryService" behaviorConfiguration="webHttp" bindingConfiguration="sslBinding" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="webHttp">
<webHttp />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
它如果我可以繼續使用Visual Studio的開發服務器進行開發將會非常好。有什麼我需要啓用與Visual Studio開發服務器爲它使用HTTPS?還是有什麼我可以在我的web.config中修改,使其發揮很好?
我在想,我不想使用IIS Express的這一點,但該鏈接由設置了一切方便。謝謝! –