繁体   English   中英

从 http 访问 WCF 服务时出现 500 内部服务器错误并且由于相同原因无法添加服务引用

[英]500 Internal Server error while accessing WCF service from http and unable to add service reference for the same reason

我正在尝试访问驻留在我网站子域中的 WCF 服务。 子域所在服务器的属性如下:

  • 它具有基本身份验证
  • 它有 4.0 .NET 版本

但问题是,当我尝试访问像http://mysubdomain.mydomain.com/Service1.svc这样的服务时,它给了我

500 - 内部服务器错误。

虽然它在本地主机上运行良好。 我还将 web.config 中的属性更改为:

<services>
      <service behaviorConfiguration="WCFService.Service1Behavior"
        name="WCFService.WrangleCore">
        <endpoint address="http://mysubdomain.mydomain.com/ServiceCore.svc" binding="basicHttpBinding" contract="WCFService.IService1">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
      </service>
    </services>

    <behaviors>
      <serviceBehaviors>
        <behavior name="WCFService.Service1Behavior">
          <!-- To avoid disclosing metadata information, set the value below to false 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>
  </system.serviceModel>

请告诉我解决这个问题的方法。

值得检查您的 DNS 后缀是否配置正确。 由于一个愚蠢的拼写错误,我也看到了它!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM