简体   繁体   中英

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

I am trying to access my WCF service that resides on a sub-domain on my website. The properties of server on which sub-domain is situated is as follows:

  • It has basic authentication
  • It has 4.0 .NET version

But the problem is, when I try to access the service like http://mysubdomain.mydomain.com/Service1.svc it gives me

500 - Internal server error.

Although it is working fine from localhost. I also changed the properties in the web.config as:

<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>

Please tell me the solution to this.

It is worth checking if your DNS suffixes are correctly configured. I have seen it to due to a silly spelling mistake as well!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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