WCF Web.Config不使用https [英] WCF Web.Config not working with https

查看:97
本文介绍了WCF Web.Config不使用https的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个wcf服务,它给我以下错误。



I have a wcf service that is giving me the following error.

Failed to add a service. Service metadata may not be accessible. Make sure your service is running and exposing metadata.





我已经搜索了很多但仍然无法弄清楚如何正确配置我的web.config。

下面是我的web.config。





I've googled quite a bit but still can't figure out how to correctly configure my web.config.
Below is my web.config.

<?xml version="1.0"?>
<configuration>

  <connectionStrings>
  </connectionStrings>
  <system.web>
    <compilation debug="true" targetFramework="4.0" />
    <customErrors mode="Off" >
    </customErrors>
  </system.web>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="true"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <bindings>
      <basicHttpBinding>
        <binding name="wsHttpBinding">
          <security mode="Transport">
            <transport clientCredentialType="None"/>
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>
    <services>
      <service name="NIM_Latency_Service.NIM_Latency">
        <endpoint address="" binding="basicHttpBinding" bindingConfiguration="wsHttpBinding"

          contract="NIM_Latency_Service.LatencyServiceContract" />
        <endpoint address="https://services.oscautomation.com/NIM_Latency.svc" binding="mexHttpsBinding" contract="IMetadataExchange" />
      </service>
    </services>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="false" />
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

</configuration>





感谢任何帮助!



Any Help is appreciated!

推荐答案

你是否已经声明了ServicContract&DataContracts
did u declared ServicContract & DataContracts Exactly


这篇关于WCF Web.Config不使用https的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆