0
votes

I created and deployed a pretty simple WCF Service. but when accessing it from IE, I get this :

HTTP Error 500.19 - Internal Server Error
Description: The requested page cannot be accessed because the related configuration  
data for the page is invalid. 

Error Code: 0x80070005 

Notification: BeginRequest 

Module: IIS Web Core 

Requested URL: http://localhost:80/ProductsService/ProductsService.svc 

Physical Path: C:\Users\Administrator\Documents\Visual Studio 2008\Projects\ProductsService\ProductsService\ProductsService.svc 

Logon User: Not yet determined 

Logon Method: Not yet determined 

Handler: Not yet determined 

Config Error: Cannot read configuration file 

Config File: \\?\C:\Users\Administrator\Documents\Visual Studio 2008\Projects \ProductsService\ProductsService\web.config 

Config Source:    -1: 
                   0: 
More Information... This error occurs when there is a problem reading the  configuration file for the Web server or Web application. In some cases, the event logs  may contain more information about what caused this error. 

here is the content of my web.config file :

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <configSections>
        <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    </configSections>
    <dataConfiguration defaultDatabase="AdventureWorksConnection" />
    <connectionStrings>
        <add name="AdventureWorksConnection" connectionString="Database=AdventureWorks;    Server=(localhost)\SQLEXPRESS;Integrated  Security=SSPI"
            providerName="System.Data.SqlClient" />
    </connectionStrings>

  <system.serviceModel>
    <services>
      <service name="Products.ProductsService">
        <endpoint address=""
        binding="basicHttpBinding"
        contract="Products.IProductsService" />
      </service>
    </services>
  </system.serviceModel>

</configuration>
3
I believe your IIS doesn't know about the .svc files yet - see this blog post for more info and explanation how to fix that: rogerpence.com/blog/?p=280marc_s
Have a look at my answer on stackoverflow.com/questions/5091640/…. Hope this helps...Murat Yıldız

3 Answers

2
votes

Well, it looks like your service exposes no metadata exchange at all - you'll need to add at least the serviceMetadata behavior so that clients can inquire about the service's metadata, and if you want to be able to retrieve that using a browser, you'll also need to enable the httpGet on that serviceMetadata behavior:.

Extend your web.config like this:

  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior name="Metadata">
          <serviceMetadata httpGetEnabled="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <services>
      <service name="Products.ProductsService" behaviorConfiguration="Metadata">
        <endpoint address=""
        binding="basicHttpBinding"
        contract="Products.IProductsService" />
      </service>
    </services>
  </system.serviceModel>

Marc

2
votes

Check the web application folder permission and make sure the following users and groups are included with full permissions: \IIS_IUSRS and \IUSR.

0
votes

for the 404.3 error have you taken a look at this link?

Hope this helps.