Cannnot access .svc on a RESTFul WCF Service deployed on local IIS WebServer

Last post 10-29-2009 2:16 PM by bhargava. 1 replies.

Sort Posts:

  • Cannnot access .svc on a RESTFul WCF Service deployed on local IIS WebServer

    10-28-2009, 3:29 PM


    Hey Guys n Gals,

    I need help, I'm new to the WCF world having recently made the transition from SOAP Webservices.

    The WCF service works well when I run in from the VS2008 ASP.NET Development Server i.e. Debug Mode. The problem comes when I try to access the service via IIS.

    I've setup a website on my local IIS Webserver hosted on port 8082 (http://localhost:8082) and have created a VirtualDirectory (1.0) that points to the physical directory that contains my WCF Service code. The Website is setup to do ASP.NET 2.0.50727. I can get to the landing page and also an assortment of .aspx pages but when I try to access the Service.svc, the browser never gets there and just sits idling.

    http://localhost:8082/1.0/Service.svc

    My question is what setup am I missing to get the service to work from inside IIS since I already know it works under the development server.

    I'm attaching part of my web.config if that would help.

    <system.serviceModel>
        <services>
            <service name="Service1" behaviorConfiguration="Service1Behavior">
                <!-- Service Endpoints -->
                <endpoint address="" binding="wsHttpBinding" contract="IService1">
                    <!--
              Upon deployment, the following identity element should be removed or replaced to reflect the
              identity under which the deployed service runs.  If removed, WCF will infer an appropriate identity
              automatically.
          -->
                    <identity>
                        <dns value="localhost"/>
                    </identity>
                </endpoint>
                <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
            </service>
        </services>
        <behaviors>
            <serviceBehaviors>
                <behavior name="Service1Behavior">
                    <!-- 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="true"/>
                </behavior>
            </serviceBehaviors>
        </behaviors>
    </system.serviceModel>


  • Re: Cannnot access .svc on a RESTFul WCF Service deployed on local IIS WebServer

    10-29-2009, 2:16 PM
    • Member
      2 point Member
    • bhargava
    • Member since 01-10-2006, 6:15 AM
    • Posts 6

    WCF Settings:

    1)      The following steps need to be performed to make sure that .svc handler is attached to the Website which contains the WCF Service.

    1. Right click on the web site (containing AppFacadeService) and click on properties option.
    2.  Click on the configuration button.
    3. In the Application Extensions section, make sure that it contains extension for .svc file; make sure that it is pointing to the aspnet_isapi.dll
    4. Make sure that “All verbs” is selected by default.

     

    2)      Run the following command from the command prompt to make sure the WCF service model is registered.

     

    "C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe" -r -y

    (Replace the path accordingly if framework is installed on a different drive)


    Let me know if this works..

    Filed under: , ,
Page 1 of 1 (2 items)