REST services not working when migrating to production receive 404 error

Discussion in 'General troubleshooting' started by bsilvers, Apr 2, 2013.

  1. Hi everyone,

    Our production servers are pretty old and running Windows 2003 with IIS 6 and .net 3.5. I recently developed some REST services that I'm having problems getting to work on the production server. We do have other NON REST WCF services that work fine so not sure what is going on here. The REST services work fine on my development VM. On the production server I can get to the .svc file but I can not get to the rest GET calls as they all give me 404 errors. I even went to extent of making a very simple REST service that returns a string and I get the same 404 errors.. Both my machine and the production servers have the same version of the System.ServiceModel.dll so I am at a lost as to what to look for now.. It is very annoying :(

    Thanks in advance for any help on this.

    -Brian

    One of my interface operations

    [OperationContract]
    [WebGet(UriTemplate = "GetProfiles",
    BodyStyle = WebMessageBodyStyle.WrappedRequest,
    RequestFormat = WebMessageFormat.Json,
    ResponseFormat = WebMessageFormat.Json)]
    List<Profile> GetProfiles();


    My ServiceModel Section from my web.config

    <system.serviceModel>
    <services>
    <service name="AprRestServices.ProfileService">
    <endpoint binding="webHttpBinding" behaviorConfiguration="webHttp" contract="AprRestServices.IProfileService">

    </endpoint>
    </service>
    </services>
    <behaviors>
    <endpointBehaviors>
    <behavior name="webHttp">
    <webHttp/>
    </behavior>
    </endpointBehaviors>
    </behaviors>
    </system.serviceModel>
     
  2. We figured this out. The virtual directories were missing the .svc application mappings. Not sure why it wasn't there and why this only affected our REST services.
     
  3. Elshadriel

    Elshadriel Winhost Staff

    Glad you figured it out, and thanks for posting the solution. I'm sure it will help someone out. :)
     

Share This Page