2014-04-10 59 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

我更新了问题 –