【问题标题】:https not working for virtual diractoryhttps 不适用于虚拟目录
【发布时间】:2014-04-10 08:09:43
【问题描述】:

我为我的网站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。谁能帮我解决这个问题。我在网上搜索了很多,但对我没有任何帮助

下面是我的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>

【问题讨论】:

    标签: c# wcf ssl iis-7 virtual-directory


    【解决方案1】:

    您需要更新服务的绑定以使用传输安全性。添加安全绑定,例如:

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

    然后更改您的服务配置以使用该绑定。

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

    更多信息http://msdn.microsoft.com/en-us/library/hh556232(v=vs.110).aspx

    【讨论】:

    • 我在我的 wcf 应用程序的 webconfig 中添加了这个,但没有用
    • 你能用你的网络配置的相关部分更新问题吗?
    猜你喜欢
    • 1970-01-01
    • 2012-01-29
    • 2012-05-29
    • 2022-01-11
    • 2013-01-13
    • 1970-01-01
    • 2014-02-17
    • 2011-01-08
    • 1970-01-01
    相关资源
    最近更新 更多