none
Rest service is not working in Windows server 2012 (IIS8) RRS feed

  • Question

  • Hello,

    I have a REST web service which was working fine in almost all windows OS. Now I have to migrate it to a Windows server 2012 (IIS 8.0). I have faced several issues during this task.

    1) First I have got the following exception

    HTTP Error 500.19 - Internal Server Error
    
    The requested page cannot be accessed because the related configuration data for the page is invalid.
    
    Config Error : Handler "svc-Integrated" has a bad module "ManagedPipelineHandler" in its module list

    2) After resolving this (Using the information provided here), I have got another one as follows...

    HTTP Error 500.19 - Internal Server Error
    
    The requested page cannot be accessed because the related configuration data for the page is invalid.
    
    Config Error :    Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to
    'svc-Integrated'
    Can someone please (I am still stuck up here) help me to fix this?

    Thanks in advance
    Sebastian



    • Edited by sxavier007 Friday, October 18, 2013 4:43 AM
    Monday, September 23, 2013 5:49 AM

All replies

  • Hi,

    As the error said:

    Theresource cannot be found.
    Description:HTTP 404. Theresource you are looking for (orone of its dependencies)could have been removed, had its name changed, or istemporarily unavailable. Please review the following URL and make sure that it isspelled correctly.

    So first please try to make sure the URL address is correct according to the endpoint address.

    Then please try to refer to the following:
    WCF services don’t run on IIS 8 with the default configuration, because the webserver doesn’t know how to handle incoming requests targeting .svc files.
    But we can let the the wcf services run on IIS 8 with the following two steps:

    1. Add a new MIME type:

    Extension: .svc       
    MIME type: application/octet-stream

    iis8-svc-mime-type

     

    2. Add a new Managed HTTP Handler:

    Request path: *.svc      
    Type: System.ServiceModel.Activation.HttpHandler      
    Name: svc-Integrated

    iis8-svc-handler

    Best Regards,
    Amy Peng


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.



    Monday, September 23, 2013 8:19 AM
    Moderator
  • Hello Amy Peng,

    I am very sorry for my mistake. During the trial & error methods, I had removed the 'http handler', And forgot to add it again. So I have updated the question also.

    Thanks & regards
    Sebastian


    • Edited by sxavier007 Tuesday, September 24, 2013 10:07 AM
    Monday, September 23, 2013 9:25 AM
  • Are you trying to set this up as self-hosted or as hosted in a site?  If you are trying to host it in a site, have you confirmed that the site is set up?  Have you placed a test HTML file in that location and confirmed that it can be browsed remotely?

    If my response was helpful, please vote it as helpful. If I have answered the question being asked, please mark my post as the answer.

    Monday, September 23, 2013 5:47 PM
  • Hi more_wagon,

    Thanks for your reply. As the name suggests, I am trying to host it in IIS.

    NB: I have updated the question.

    Regards
    Sebastian

    Tuesday, September 24, 2013 10:49 AM
  • If in fact you are seeing this error:

    Config Error :    Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to
    'svc-Integrated' 

    You need to remove the duplicate value from the config file, as the error indicates.


    If my response was helpful, please vote it as helpful. If I have answered the question being asked, please mark my post as the answer.

    Tuesday, September 24, 2013 12:43 PM
  • Hi more_wagons,

    I have already checked that, & I didn't see any entries corresponding to 'svc-Integrated'

    Here is my 'Handlers' tag...

    <handlers>
       <remove name="WebServiceHandlerFactory-Integrated"/>
       <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" 
    type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
    PublicKeyToken=31BF3856AD364E35"/> <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode"
    type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
    PublicKeyToken=31BF3856AD364E35"/> <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd"
    type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
    PublicKeyToken=31BF3856AD364E35"/> </handlers>

    Should I check for any other config files?

    Thanks for your help...

    Sebastian


    Thursday, September 26, 2013 9:34 AM
  • Hi,

    I am sorry for the late reply.

    I see that you have meet the following error:

    HTTP Error 500.19 - Internal Server Error

    Therequested page cannot be accessed because the related configuration data forthe page isinvalid.

    Config Error : Handler "svc-Integrated"has a bad module "ManagedPipelineHandler" inits modulelist

    For this error, please try to check the following:
    1.Open Visual Studio Command Prompt
    2.Type the following:  1.aspnet_regiis.exe -i
    3.Run the command
    4.Try your service again

    For more information, please try to refer to the following articles:
    http://blogs.msdn.com/b/keithmg/archive/2010/11/08/wcf-error-500-21-handler-quot-svc-integrated-quot-has-a-bad-module-quot-managedpipelinehandler-quot-in-its-module-list-quot.aspx .
    http://www.limguohong.com/tag/handler-svc-integrated-has-a-bad-module-managedpipelinehandler-in-its-module-list/ .

    Best Regards,
    Amy Peng


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    Tuesday, October 1, 2013 8:05 AM
    Moderator
  • Hi Amy,

    Thanks for your reply. I was on vacation for last few days.
    Visual studio is not installed in target machine(2012 server), SO is it possible to get the VS command prompt in any other way?. It is not needed to have visual studio on target machine, right? Please advice.

    Thanks once again.

    Sebastian

    Monday, October 7, 2013 9:19 AM