我已經創建並測試了WCF服務,一切正常。https環境下的WCF服務
當我部署到測試環境,並試圖打開https://my.site/myapp/EnrollmentService.svc我已經得到了錯誤信息:
找不到的基址,對於端點 與結合 MetadataExchangeHttpBinding 比賽計劃http。 註冊基地址方案是 [https]。
互聯網向我表明我需要添加一些更多的配置選項:
http://www.codeproject.com/KB/WCF/7stepsWCF.aspx
我已經添加了一些設置,以服務web.config文件。現在看來,以下列方式:
<system.serviceModel>
<services>
<service name="McActivationApp.EnrollmentService" behaviorConfiguration="McActivationApp.EnrollmentServicBehavior">
<endpoint
address="https://my.site/myapp/EnrollmentService.svc"
binding="basicHttpBinding"
bindingConfiguration="TransportSecurity"
contract="McActivationApp.IEnrollmentService"/>
<endpoint address="mex" binding="mexHttpBinding" contract="McActivationApp.IEnrollmentService" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="McActivationApp.EnrollmentServicBehavior">
<serviceMetadata httpGetEnabled="True"/>
<serviceDebug includeExceptionDetailInFaults="False" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding name="TransportSecurity">
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
</system.serviceModel>
其實,我已經添加了「綁定」部分,指定它爲我的終點。
但是這什麼都沒有改變......
請指教,我需要做的。非常感謝!
P.S.從https和http資源消耗WCF服務有什麼區別?
非常好!非常感謝! – Budda 2011-01-10 22:12:10
......但是......在改變之後,網站開始在通常的「http」下工作,這是不允許的...... – Budda 2011-01-10 22:29:03