2014-04-10 15 views
0

我爲我的網站https://www.test.com配置了SSL。我有一個虛擬的令人難以置信的testwcf。當我用https://www.test.com/testwcf/Common.svc訪問它。顯示消息You have created a service.但是當我訪問任何服務方法時,例如 https://www.test.com/testwcf/Common.svc/select?id=1我收到錯誤The resource cannot be found.。但它對http正常工作,即http://www.test.com/testwcf/Common.svc/select?id=1。任何人都可以幫助我解決這個問題。我搜索的淨很多,但沒有工作對我來說https不適用於虛擬對象

下面是我websconfg

<services> 

    <service name="testwcf.Service1"> 
    <endpoint address="" 
       binding="basicHttpBinding" 
       bindingConfiguration="secureHttpBinding" 
       contract="testwcf.IService1"/> 

    <endpoint address="mex" 
       binding="mexHttpsBinding" 
       contract="IMetadataExchange" /> 
    </service> 
    </services> 
    <bindings> 
    <basicHttpBinding> 
    <binding name="secureHttpBinding"> 
     <security mode="Transport"> 
     <transport clientCredentialType="None"/> 
     </security> 
    </binding> 
    </basicHttpBinding> 
</bindings> 
    </system.serviceModel> 

回答

0

你需要更新您的服務使用傳輸安全機制的結合。添加一個安全綁定,如:

<bindings> 
    <basicHttpBinding> 
    <binding name="secureHttpBinding"> 
     <security mode="Transport"> 
     <transport clientCredentialType="None"/> 
     </security> 
    </binding> 
    </basicHttpBinding> 
</bindings> 

然後更改您的服務配置以使用該綁定。在http://msdn.microsoft.com/en-us/library/hh556232(v=vs.110).aspx

+0

<services> <service name="MySecureWCFService.Service1"> <endpoint address="" binding="basicHttpBinding" bindingConfiguration="secureHttpBinding" contract="MySecureWCFService.IService1"/> <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" /> </service> </services> 

更多信息我說這在我的WCF廣告應用程式的webconfig但沒有工作 –

+0

您可以更新您的Web配置的相關部分的問題? – DoctorMick

+0

我更新了問題 –