我有三個不同的WCF服務部署在服務器上,分別位於IIS中「Default WebSites」下的自己的應用程序目錄中。其中一項服務由我部署,另外兩項服務由其他客戶部署。有一個服務器證書部署在IIS中,我綁定了我的服務。使用單一證書託管多個WCF服務
但是,當我嘗試訪問我的服務形式的https我得到這個錯誤在彈出:。
「地址不匹配 此網站出具的安全證書發出了不同的網站的地址 這個問題可能顯示試圖欺騙您或截獲您向服務器發送任何數據。「
我服務的禰web.config文件是如下
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<identity impersonate="false" />
</system.web>
<system.serviceModel>
<services>
<service name="WcfApp.Service">
<endpoint address="customer"
binding="basicHttpBinding"
bindingConfiguration="secureHttpBinding"
contract="WCFApp.ICustomerService" />
<endpoint address="order"
binding="basicHttpBinding"
bindingConfiguration="secureHttpBinding"
contract="WcfApp.IOrderService" />
<endpoint address="mex"
binding="mexHttpsBinding"
contract="IMetadataExchange" />
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="secureHttpBinding">
<security mode="Transport">
<transport clientCredentialType="None"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior >
<serviceMetadata httpsGetEnabled="True" />
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceThrottling maxConcurrentCalls="21" maxConcurrentSessions="50" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<directoryBrowse enabled="true" />
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>
</configuration>
有趣的是,當我打以下網址: https://myserverurl.com/applicationfolder/service.svc?wsdl
得到WSDL,它完美地運行,並返回我的WSDL描述,但原來的呼叫不能正常工作。
爲什麼我得到「不匹配的地址」?是否需要添加主機基地址?如果是,在web.config中如何以及在何處添加它,是否需要將其添加到其他兩個部署的wcf服務中?端口是否與證書衝突?我是新來的wcf請幫我解決這個問題?
我使用.net 4.0,IIS 7.0,windows server 2008.
在此先感謝。