OData service 404 error

Discussion in 'Site Programming, Development and Design' started by mule, Sep 20, 2010.

  1. Hi,

    Does anyone have experience running OData on Winhost?

    My OData service works fine on my laptop IIS but when I upload it to my site I get 404 Resource not found error when trying to access the .svc-file.

    Earlier I had 2 different authentications on so I got the "System.InvalidOperationException: IIS specified authentication schemes 'Basic, Anonymous'...." error so I know that at that point the handler was trying to start the service.

    After fixing that, I got the "Resource not found error". :mad:

    If anyone has a solution to this, help would be much appreciated.
     
  2. Ray

    Ray

    I'm afraid there is not enough information to troubleshoot this. Can you verify if "OData" is Bin deployable or does it need to be installed on the server? If it is Bin deployable, did you upload all the necessary files in your applications Bin folder?
     
  3. OData is a WCF Data Service so it needs a .svc-file to start and then it needs the assembly where the service is defined in and it uses: System.Data.Services and System.Data.Services.Common. The assembly where the service is defined in is in bin folder and Data.Services assemblies should come with .net 4.0.
     
  4. Ray

    Ray

    Do you have a URL we can look at?
     
  5. Ray

    Ray

    The error message does not give us enough clues. Try checking the .svc file itself and check all the components or files it is calling on. Make sure it exist in your root or if it is an assembly that the assembly is loaded in the correct Bin folder.

    Also try downloading fiddler. It is a tool that helps debug web applications.

    http://www.fiddler2.com/fiddler2/

    This might help you shed some light on the problem.
     
  6. Finally got this figured out. Ray was right there was a vital piece of information missing from my problem description.

    It occured to me that since my site is an ASP.NET MVC 2 site I need to ignore the route to the service. Otherwise ASP.NET will start looking for a controller for that URI.

    So I added routes.IgnoreRoute("Services/SilverlightCVService.svc/{*pathInfo}"); to my global.asax.cs and voilá problem solved.

    Many thanks to Ray from Winhost for taking the effort to try to solve this.
     
  7. Thanks for posting a follow up.
     

Share This Page