IIS 7 and WCF 4 REST Service and dataportal configuration

IIS 7 and WCF 4 REST Service and dataportal configuration

Old forum URL: forums.lhotka.net/forums/t/12572.aspx


Tatjana posted on Wednesday, April 02, 2014

Hello everyone,

I have developed wcf .net 4 REST service that uses the wcf dataportal. Both services are hosted in IIS 7 in same web app.  Parts of the web.config are enclosed at the end of this message.  

My wcf service runs successfully on ASP.NET developer server, but not in the IIS web server.  When accessing an API from web browser on port 80, I keep receiving this exception message:

Exception has been thrown by the target of an invocation

Would you have any ideas why could this be happening?  

 

The web,config:

<?xml version="1.0"?>

<configuration>

  <appSettings>

    <add key="MyDbName" value="MY_DB" />

    <add key="CslaAuthentication" value="Csla"/>

  </appSettings>

  <connectionStrings/>

  <system.serviceModel>

    <protocolMapping>

      <add scheme="http" binding="webHttpBinding" />

    </protocolMapping>

    <behaviors>

      <serviceBehaviors>

        <behavior name="WebServiceBehavior">

          <serviceMetadata httpGetEnabled="true"/>

          <serviceDebug includeExceptionDetailInFaults="true"/>

        </behavior>

        <behavior name="returnFaults">

          <serviceDebug includeExceptionDetailInFaults="true" />

        </behavior>

      </serviceBehaviors>

      <endpointBehaviors>

        <behavior name="RESTEndpointBehavior">

          <webHttp />

        </behavior>

      </endpointBehaviors>

    </behaviors>

    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" minFreeMemoryPercentageToActivateService="1" />

    <services>

      <service behaviorConfiguration="WebServiceBehavior" name="Something">

        <endpoint address="" binding="webHttpBinding" contract="ISomethingContract" behaviorConfiguration="RESTEndpointBehavior" />

        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>

        <host>

          <baseAddresses>

            <add baseAddress="http://localhost:8000" />

          </baseAddresses>

        </host>

      </service>

      <service name="Csla.Server.Hosts.WcfPortal" behaviorConfiguration="returnFaults">

        <endpoint binding="wsHttpBinding" contract="Csla.Server.Hosts.IWcfPortal" bindingConfiguration="WSHttpBinding_IWebService"/>

      </service>

    </services>

    <bindings>

      <wsHttpBinding>

        <binding name="WSHttpBinding_IWebService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">

          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>

          <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/>

          <security mode="None">

            <transport clientCredentialType="None"/>

          </security>

        </binding>

      </wsHttpBinding>

    </bindings>    

  </system.serviceModel>

  <system.web>

    <sessionState mode="InProc" cookieless="true" regenerateExpiredSessionId="false" timeout="20"/>

    <compilation debug="true" targetFramework="4.0">

    </compilation>

    <authentication mode="Windows"/>

       <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>

  </system.web> 

</configuration>

 

Thank you in advance,
Tanja

PS. The web site is setup in the ASP.NET v4.0 Application pool  (Integrated managed pipeline mode and ApplicationPoolIdentity for indenty) and the WcfPortal.svc is located in the same location where my svc file is.

Copyright (c) Marimer LLC